From 220a208f4e77578ef5197e5d26f0da446ee25840 Mon Sep 17 00:00:00 2001 From: 0Pranav Date: Thu, 19 Dec 2019 12:27:32 +0530 Subject: [PATCH] fix: default timezone selection --- erpnext/www/book_appointment/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/www/book_appointment/index.js b/erpnext/www/book_appointment/index.js index b13f18893c1..3c296980688 100644 --- a/erpnext/www/book_appointment/index.js +++ b/erpnext/www/book_appointment/index.js @@ -25,15 +25,15 @@ async function get_global_variables() { function setup_timezone_selector() { let timezones_element = document.getElementById('appointment-timezone'); - let offset = new Date().getTimezoneOffset(); + let local_timezone = moment.tz.guess() window.timezones.forEach((timezone) => { let opt = document.createElement('option'); opt.value = timezone; - if (timezone == moment.tz.guess()) { + if (timezone == local_timezone) { opt.selected = true; } - opt.innerHTML = timezone - timezones_element.appendChild(opt) + opt.innerHTML = timezone; + timezones_element.appendChild(opt); }); }