mde / timezone-js

DEPRECATED: Timezone-enabled JavaScript Date object. Uses Olson zoneinfo files for timezone data.
824 stars 183 forks source link

Insert an inexistent time #69

Closed abgil closed 4 years ago

abgil commented 11 years ago

For example in Madrid the DST change 3am to 2am at 10/27/2013 if you insert a hour between 1-3 the time result is a GMT 0:

var dt1 = new timezoneJS.Date(1382835540000, 'Europe/Madrid' ); ==> Sun Oct 27 2013 00:59:00 GMT+0 TimezoneJS.Date {_useCache: false, _tzInfo: Object, _day: 0, year: 2013, month: 9…} _dateProxy: Sun Oct 27 2013 02:59:00 GMT+0200 (Hora de verano romance)

var dt2 = new timezoneJS.Date(1382835600000, 'Europe/Madrid' ); ==> Sun Oct 27 2013 01:00:00 GMT+0 TimezoneJS.Date {_useCache: false, _tzInfo: Object, _day: 0, year: 2013, month: 9…} _dateProxy: Sun Oct 27 2013 03:00:00 GMT+0100 (Hora estándar romance)

var dt3 = new timezoneJS.Date(1382842740000, 'Europe/Madrid' ); ==> Sun Oct 27 2013 02:59:00 GMT+0 TimezoneJS.Date {_useCache: false, _tzInfo: Object, _day: 0, year: 2013, month: 9…} _dateProxy: Sun Oct 27 2013 04:59:00 GMT+0100 (Hora estándar romance)

var dt3 = new timezoneJS.Date(1382842800000, 'Europe/Madrid' ); ==> Sun Oct 27 2013 03:00:00 GMT+0 TimezoneJS.Date {_useCache: false, _tzInfo: Object, _day: 0, year: 2013, month: 9…} _dateProxy: Sun Oct 27 2013 04:00:00 GMT+0100 (Hora estándar romance)