Skip to content

Commit

Permalink
fix: always consider timezone when set allday schedule period(fix nhn…
Browse files Browse the repository at this point in the history
  • Loading branch information
lhysdl committed Aug 27, 2020
1 parent 3f22f76 commit 1512dc6
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/js/model/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,22 +269,8 @@ Schedule.prototype.init = function(options) {
};

Schedule.prototype.setAllDayPeriod = function(start, end) {
// If it is an all-day schedule, only the date information of the string is used.
if (util.isString(start)) {
start = datetime.parse(start.substring(0, 10));
} else {
start = new TZDate(start || Date.now());
}
if (util.isString(end)) {
end = datetime.parse(end.substring(0, 10));
} else {
end = new TZDate(end || this.start);
}

this.start = start;
this.start.setHours(0, 0, 0);
this.end = end || new TZDate(this.start);
this.end.setHours(23, 59, 59);
this.start = datetime.start(new TZDate(start || Date.now()));
this.end = datetime.end(new TZDate(end || this.start));
};

Schedule.prototype.setTimePeriod = function(start, end) {
Expand Down

0 comments on commit 1512dc6

Please sign in to comment.