From d7084ce0c855b253160aab3126289bf829f1f06d Mon Sep 17 00:00:00 2001 From: Alys Date: Sun, 5 Jul 2015 17:39:11 +1000 Subject: [PATCH] remove unnecessary default for dailyTask.startDate (website/src/models/task.js gives default); give user's timezone to their task startDate values (possible solution for https://github.com/HabitRPG/habitrpg/issues/5395 https://github.com/HabitRPG/habitrpg/issues/5510 https://github.com/HabitRPG/habitrpg/issues/5549) --- common/script/index.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/script/index.coffee b/common/script/index.coffee index 789ba7ecae..c78a0552bb 100644 --- a/common/script/index.coffee +++ b/common/script/index.coffee @@ -83,8 +83,7 @@ api.shouldDo = (day, dailyTask, options = {}) -> o = sanitizeOptions options startOfDayWithCDSTime = api.startOfDay(_.defaults {now:day}, o) # a moment() - # If the Daily does not have a Start Date (old tasks predating the Start Date feature), we assume it starts on the day being checked. This does not cause a bug with the Every X Days option because if the user had edited the task to select X days, then a start date would have been saved to the task at the same time. - taskStartDate = dailyTask.startDate || day + taskStartDate = moment(dailyTask.startDate).zone(o.timezoneOffset) # The time portion of the Start Date is never visible to or modifiable by the user so we must ignore it. # Therefore, we must also ignore the time portion of the user's day start (startOfDayWithCDSTime), otherwise the date comparison will be wrong for some times.