[OPEN-125] DST issue calculating Day numbers in MonthView

Report bugs for any Extensible Components

Re: [OPEN-125] DST issue calculating Day numbers in MonthVie

Postby gmenezesg » Tue May 12, 2015 11:31 am

Here are my findings about this. Turns out (in Brazil), the day the DST becomes valid, there is no midnight (at midnight the clock advances one our - same thing occurs backwards when DST ends in February [two midnights]). Ways to reproduce: Change your timezone to UTC -3 (Brasilia) and open browser console. Evaluate the expressions:
new Date(2015, 9, 17, 0, 0, 0)
new Date(2015, 9, 18, 0, 0, 0)
new Date(2015, 9, 19, 0, 0, 0)

You would expect to get midnight from each date, but at October 18 the returned date is:

Sat Oct 17 2015 00:00:00 GMT-0300 (E. South America Standard Time)
Sun Oct 18 2015 01:00:00 GMT-0200 (E. South America Daylight Time)
Mon Oct 19 2015 00:00:00 GMT-0200 (E. South America Daylight Time)

See? No midnight!

Even though this is right (no midnight, according to Brazilian laws), the calendar still does not show the events for this day. It dos not even show the events for the whole week and the week after that.

After doing some debugging, I found out something that appears to be the point here. In the extensible-all-debug.js file, locate the "prepareData" function (inside AbstractCalendar definition) and then locate the line that declares the startsOnDate variable. It compares the event start date with the day view object and returns true or false if the "begining dates, or first hour of these dates" are equal.

What I did was to make sure both dates are "cleared" before the comparisson, so the code:

"startsOnDate = dt.getTime() == startDt.getTime(),"


"startsOnDate = Ext.Date.clearTime(dt).getTime() == startDt.getTime(),"

Hope it helps.
Posts: 1
Joined: Tue May 12, 2015 11:04 am


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest