Skip to content

Commit 8d3b525

Browse files
author
Levi Zitting
committed
Switch to getTime instead of dividing by 1 for getting epoch timestamps
1 parent ae7f6db commit 8d3b525

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

recurrence/static/recurrence/js/recurrence-widget.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ recurrence.widget.Calendar.prototype = {
238238
month != this.date.getMonth() ||
239239
day != this.date.getDate()) {
240240

241-
this.date.setTime(new Date(year, month, day) / 1);
241+
this.date.setTime(new Date(year, month, day).getTime());
242242

243243
recurrence.array.foreach(
244244
this.elements.month_grid.cells, function(cell) {
@@ -404,7 +404,7 @@ recurrence.widget.DateSelector.prototype = {
404404
if (!this.date)
405405
this.date = recurrence.widget.date_today();
406406

407-
this.date.setTime(new Date(year, month, day) / 1);
407+
this.date.setTime(new Date(year, month, day).getTime());
408408

409409
this.elements.date_field.value = datestring;
410410

recurrence/static/recurrence/js/recurrence.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ recurrence.deserialize = function(text) {
681681
if (text.indexOf('Z') > 0) {
682682
dt.setTime(Date.UTC(year, month - 1, day, hour, minute, second) / 1);
683683
} else {
684-
dt.setTime(new Date(year, month - 1, day, hour, minute, second) / 1);
684+
dt.setTime(new Date(year, month - 1, day, hour, minute, second).getTime());
685685
}
686686
return dt;
687687
};

0 commit comments

Comments
 (0)