Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when no other clocks are defined #6

Open
to-scho opened this issue Feb 16, 2020 · 1 comment
Open

Error when no other clocks are defined #6

to-scho opened this issue Feb 16, 2020 · 1 comment

Comments

@to-scho
Copy link

to-scho commented Feb 16, 2020

Please add handling of use case when no other clocks are given. E.g.

       var otherclocks = ``;
        if (_other_timezones) {
			//Build List of Other Timezones
			//
			otherclocks = otherclocks + `
				<div class = "other_clocks">
				`;
			var i;
			var j = _other_timezones.length; //TODO: Recommend max 3.
			for (i= 0; i < j; i++) {
				//Format other timezones.
				var _tztime = _date_time.toLocaleTimeString(_locale, {
					hour: 'numeric',
					minute: 'numeric',
					timeZone: _other_timezones[i],
					weekday: 'short'
				}); 
			
				// List other Timezones.
				otherclocks = otherclocks + `
					<div class="tz_locale">${_other_timezones[i]} </div> 
					<div class="otime"> ${_tztime} </div>
				`;
				//console.log(_tztime);
			};
			otherclocks = otherclocks + `
				</div>
				`;
			/*console.log(otherclocks);*/
		} 
@rumunn95
Copy link

rumunn95 commented Nov 7, 2021

how to use this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants