fix:guess timezone using moment

This commit is contained in:
Pranav Nachanekar 2019-10-03 11:56:23 +05:30
parent 2ea9b3e6f2
commit c6da5fb38e

View File

@ -33,9 +33,11 @@ function setup_timezone_selector() {
let offset = new Date().getTimezoneOffset();
window.timezones.forEach(timezone => {
let opt = document.createElement('option');
opt.value = timezone.offset;
opt.innerHTML = timezone.timezone_name;
opt.defaultSelected = (offset == timezone.offset)
opt.value = timezone;
if(timezone == moment.tz.guess()){
opt.selected = true;
}
opt.innerHTML = timezone;
timezones_element.appendChild(opt)
});
}