continuouscalendar / jquery-continuous-calendar

Date picker and range selector with scrollable months instead of paged (the only right way to do it)
http://continuouscalendar.github.io/jquery-continuous-calendar/
85 stars 35 forks source link

IE: First and last allowed dates are one day behind when using ISO format #91

Closed vestmi closed 9 years ago

vestmi commented 9 years ago

In IE9/10/11 when using the ISO date format ("YYYY-MM-DD") in the firstDate and lastDate, the first and last allowed dates the user can select from the calendar are one day before the given dates.

For example, I use the following options to create the calendar:

calendarContainer.continuousCalendar({
        locale: DateLocale.FI,
        isPopup: true,
        useIsoForInput: true,
        firstDate: "2015-08-22",
        lastDate: "2015-12-17"
      })

In IE, the first date the user can choose from the calendar is 2015-08-21, not 2015-08-22. Moreover, the last date the user can select from the calendar is 2015-12-16, not 2015-12-17.

If you use some non-ISO format, like firstDate: "8/22/2015" and lastDate: "12/17/2015", this problem does not occur. Also Chrome and Firefox seem to work OK with this ISO date format.

This can also be quite easily reproduced e.g. in the playground with IE: http://reaktor.github.io/jquery-continuous-calendar/site/playground.html

Update: this seems to happen in all IE versions 9/10/11.

vestmi commented 9 years ago

Seems to be not a bug at all. It was just a timezone issue, where the virtualbox running the IE had a different timezone (UTC-8 when the expected timezone was UTC+2).