timezone.js doesn't handle daylight saving switches correct.
It stores the time as local time which isn't unique during daylight saving switch.
This changes fixes the problem and makes the interface more compatible to the original Date object.
This is a test example which doesn't work with the original module:
var date = new timezoneJS(2017,9,29,2,1,0,"Europe/Berlin");
var oldTime = date.getTime();
console.log(date.getTime());
console.log(date);
console.log(date.getUTCHours(), date.getUTCMinutes(), date.getTimezoneOffset());
console.log(date.getHours());
date.setUTCMinutes(date.getUTCMinutes() + 60);
console.log(date);
console.log(date.getUTCHours(), date.getUTCMinutes(), date.getTimezoneOffset());
console.log(date.getHours());
console.log((date.getTime() - oldTime)/1000/60);
timezone.js doesn't handle daylight saving switches correct. It stores the time as local time which isn't unique during daylight saving switch. This changes fixes the problem and makes the interface more compatible to the original Date object.
This is a test example which doesn't work with the original module: var date = new timezoneJS(2017,9,29,2,1,0,"Europe/Berlin"); var oldTime = date.getTime(); console.log(date.getTime()); console.log(date); console.log(date.getUTCHours(), date.getUTCMinutes(), date.getTimezoneOffset()); console.log(date.getHours()); date.setUTCMinutes(date.getUTCMinutes() + 60); console.log(date); console.log(date.getUTCHours(), date.getUTCMinutes(), date.getTimezoneOffset()); console.log(date.getHours()); console.log((date.getTime() - oldTime)/1000/60);