mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Repeatables (#8444)
* Added initial should do weekly tests * Added support back in for days of the week and every x day * Added better week day mapper * Added initial monthly * Added every x months * Added yearlies * Fixed every nth weekdy of month * Fixed tests to check every x week on weekday * Began combining x month with nth weekday * Added every x month combined with date and weekday * Fixed lint issues * Saved moment-recurr to package.json * Added new repeat fields * Added UI for repeatables * Ensured only dalies are affected by summary * Added local strings * Updated npm shrinkwrap * Shared day map constant * Updated shrinkwrap * Added ui back * Updated copy of test cases * Added new translation strings * Updated shrinkwrap * Fixed broken test * Made should do tests static for better consitency * Fixed issue with no repeat * Fixed line endings * Added frequency enum values * Fixed spacing
This commit is contained in:
@@ -222,7 +222,7 @@ export let HabitSchema = new Schema(_.defaults({
|
||||
export let habit = Task.discriminator('habit', HabitSchema);
|
||||
|
||||
export let DailySchema = new Schema(_.defaults({
|
||||
frequency: {type: String, default: 'weekly', enum: ['daily', 'weekly']},
|
||||
frequency: {type: String, default: 'weekly', enum: ['daily', 'weekly', 'monthly', 'yearly']},
|
||||
everyX: {type: Number, default: 1}, // e.g. once every X weeks
|
||||
startDate: {
|
||||
type: Date,
|
||||
@@ -240,6 +240,8 @@ export let DailySchema = new Schema(_.defaults({
|
||||
su: {type: Boolean, default: true},
|
||||
},
|
||||
streak: {type: Number, default: 0},
|
||||
daysOfMonth: {type: [Number], default: []}, // Days of the month that the daily should repeat on
|
||||
weeksOfMonth: {type: [Number], default: []}, // Weeks of the month that the daily should repeat on
|
||||
}, habitDailySchema(), dailyTodoSchema()), subDiscriminatorOptions);
|
||||
export let daily = Task.discriminator('daily', DailySchema);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user