mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Added support in daily tasks for specifying ’every X days’ and ‘every X weeks on specific days of the week’.
- shouldDo() now takes the entire task as an input instead of just the ‘repeat’ (days of the week) dictionary. - the ‘start’ date for a task can be specified (and can also be in the future, in which case it will be greyed out until then.) ‘start’ date also affects ‘every X days’ and ‘every X weeks’. - no migration code yet.
This commit is contained in:
@@ -50,10 +50,14 @@ var checklist = [{
|
||||
|
||||
var DailySchema = new Schema(
|
||||
_.defaults({
|
||||
type: {type:String, 'default': 'daily'},
|
||||
type: {type: String, 'default': 'daily'},
|
||||
//TODO: Cleaner to store interval as enum instead of str?
|
||||
frequency: {type: String, 'default': 'daily'}, // 'daily', 'weekly'
|
||||
everyX: {type: Number, 'default': 1}, // e.g. once every X weeks
|
||||
startDate: {type: Date},
|
||||
history: Array,
|
||||
completed: {type: Boolean, 'default': false},
|
||||
repeat: {
|
||||
repeat: { // used only for 'weekly' frequency, TODO: Rename to daysOfWeek or something with 'week'
|
||||
m: {type: Boolean, 'default': true},
|
||||
t: {type: Boolean, 'default': true},
|
||||
w: {type: Boolean, 'default': true},
|
||||
|
||||
Reference in New Issue
Block a user