Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 1140862 - make sure multi day view displays 24 unique hours even …
Browse files Browse the repository at this point in the history
…if built on first day of Daylight Saving Time
  • Loading branch information
millermedeiros authored and rvandermeulen committed Mar 23, 2015
1 parent dc24681 commit 3df3048
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion apps/calendar/js/templates/date_span.js
Expand Up @@ -21,7 +21,8 @@ module.exports = create({
var hour = this.h('hour');
var format = Calc.getTimeL10nLabel(this.h('format'));
var className = this.h('className');
var date = new Date();
// 0ms since epoch as base date to avoid issues with daylight saving time
var date = new Date(0);
date.setHours(hour, 0, 0, 0);

var l10nLabel = l10n.get(format);
Expand Down
2 changes: 1 addition & 1 deletion apps/calendar/test/unit/views/multi_day_test.js
Expand Up @@ -64,7 +64,7 @@ suite('Views.MultiDay', function() {
subject.handleEvent({type: 'localized'});

// make sure we rebuild all hours during localize
var i = -1, date = new Date(), hour;
var i = -1, date = new Date(0), hour;
while (++i < 24) {
date.setHours(i, 0, 0, 0);
hour = sidebar.querySelector('.md__hour-' + i);
Expand Down

0 comments on commit 3df3048

Please sign in to comment.