diff --git a/dist/habitrpg-shared.js b/dist/habitrpg-shared.js index 6c6dd3312b..fca24754ab 100644 --- a/dist/habitrpg-shared.js +++ b/dist/habitrpg-shared.js @@ -11127,7 +11127,7 @@ var process=require("__browserify_process");(function() { priority: 1, challenge: {}, attribute: 'str', - created: new Date() + dateCreated: new Date() }; _.defaults(task, defaults); if (task.type === 'habit') { @@ -12137,6 +12137,7 @@ var process=require("__browserify_process");(function() { if (options.cron) { calculateDelta(); } else { + task.dateCompleted = direction === 'up' ? new Date : void 0; calculateDelta(); addPoints(); multiplier = ((_ref3 = task.checklist) != null ? _ref3.length : void 0) || 1; diff --git a/script/index.coffee b/script/index.coffee index b0b2ae990f..28e0ba6c62 100644 --- a/script/index.coffee +++ b/script/index.coffee @@ -177,7 +177,7 @@ api.taskDefaults = (task={}) -> priority: 1 challenge: {} attribute: 'str' - created: new Date() + dateCreated: new Date() _.defaults task, defaults _.defaults(task, {up:true,down:true}) if task.type is 'habit' _.defaults(task, {history: []}) if task.type in ['habit', 'daily'] @@ -845,6 +845,7 @@ api.wrap = (user, main=true) -> calculateDelta() #don't touch stats on cron else + task.dateCompleted = if direction is 'up' then new Date else undefined calculateDelta() addPoints() # obviously for delta>0, but also a trick to undo accidental checkboxes # MP++ per checklist item in ToDo, bonus per CLI