2
0
forked from Wavyzz/dolibarr

QUAL: Remove the external js library jstimezonedetect

This commit is contained in:
Laurent Destailleur
2024-01-14 21:37:04 +01:00
parent 5577cfbb26
commit 5599ac733b
5 changed files with 6 additions and 1470 deletions

View File

@@ -25,9 +25,11 @@
$(document).ready(function () {
var timezone = jstz.determine();
console.log("Timezone detected for user: "+timezone.name());
//var timezone = jstz.determine(); // old method using jstimezonedetect library
//console.log("Timezone detected for user: "+timezone.name());
var timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
console.log("Timezone detected by Intl for user: "+timezone);
// Detect and save TZ and DST
var rightNow = new Date();
var jan1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
@@ -49,7 +51,7 @@ $(document).ready(function () {
var dst_first=DisplayDstSwitchDates('first');
var dst_second=DisplayDstSwitchDates('second');
//alert(dst);
$('#tz_string').val(timezone.name()); // returns TZ string from jstz.determine
$('#tz_string').val(timezone); // returns TZ string
$('#tz').val(std_time_offset); // returns TZ
$('#dst_observed').val(dst); // returns if DST is observed on summer
$('#dst_first').val(dst_first); // returns DST first switch in year