mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
If user's cron will happen later today, start the task yesterday. (#10783)
* If user's cron will happen later today, start the task yesterday. * Added default dayStart to taskDefaults. * Removed the need to call shouldDo twice to calculate nextDue. * Revert "Removed the need to call shouldDo twice to calculate nextDue." This reverts commit e1467f2fc33cfb11e6a4fc667460df6a48b69d45. * Removed defaults from taskDefault arguments. * Got user from $store in copyAsTodoModal.vue. * Fixed tests for taskDefaults to include mock user. * Fix shouldDo tests when run in GMT timezone. * Added test to taskDefault; added utcOffset to taskDefault. * Replaced utcOffset with zone. * Removed erroneous import.
This commit is contained in:
committed by
Matteo Pagliazzi
parent
12aef475c8
commit
a48a6a292d
@@ -228,7 +228,7 @@ describe('shouldDo', () => {
|
||||
options.timezoneOffset = 0;
|
||||
options.nextDue = true;
|
||||
|
||||
day = moment('2017-05-01').toDate();
|
||||
day = moment.utc('2017-05-01').toDate();
|
||||
dailyTask.frequency = 'daily';
|
||||
dailyTask.everyX = 2;
|
||||
dailyTask.startDate = day;
|
||||
@@ -391,7 +391,7 @@ describe('shouldDo', () => {
|
||||
options.timezoneOffset = 0;
|
||||
options.nextDue = true;
|
||||
|
||||
day = moment('2017-05-01').toDate();
|
||||
day = moment.utc('2017-05-01').toDate();
|
||||
dailyTask.frequency = 'weekly';
|
||||
dailyTask.everyX = 1;
|
||||
dailyTask.repeat = {
|
||||
@@ -780,7 +780,7 @@ describe('shouldDo', () => {
|
||||
options.timezoneOffset = 0;
|
||||
options.nextDue = true;
|
||||
|
||||
day = moment('2017-05-01').toDate();
|
||||
day = moment.utc('2017-05-01').toDate();
|
||||
|
||||
dailyTask.frequency = 'monthly';
|
||||
dailyTask.everyX = 3;
|
||||
@@ -817,7 +817,7 @@ describe('shouldDo', () => {
|
||||
expect(moment(nextDue[4]).toDate()).to.eql(moment.utc('2017-10-02').toDate());
|
||||
expect(moment(nextDue[5]).toDate()).to.eql(moment.utc('2017-11-06').toDate());
|
||||
|
||||
day = moment('2017-05-08').toDate();
|
||||
day = moment.utc('2017-05-08').toDate();
|
||||
|
||||
dailyTask.daysOfMonth = [];
|
||||
dailyTask.weeksOfMonth = [1];
|
||||
@@ -841,7 +841,7 @@ describe('shouldDo', () => {
|
||||
expect(moment(nextDue[4]).toDate()).to.eql(moment.utc('2017-10-09').toDate());
|
||||
expect(moment(nextDue[5]).toDate()).to.eql(moment.utc('2017-11-13').toDate());
|
||||
|
||||
day = moment('2017-05-29').toDate();
|
||||
day = moment.utc('2017-05-29').toDate();
|
||||
|
||||
dailyTask.daysOfMonth = [];
|
||||
dailyTask.weeksOfMonth = [4];
|
||||
@@ -1143,7 +1143,7 @@ describe('shouldDo', () => {
|
||||
options.timezoneOffset = 0;
|
||||
options.nextDue = true;
|
||||
|
||||
day = moment('2017-05-01').toDate();
|
||||
day = moment.utc('2017-05-01').toDate();
|
||||
|
||||
dailyTask.frequency = 'yearly';
|
||||
dailyTask.everyX = 5;
|
||||
|
||||
Reference in New Issue
Block a user