fix(todos): add dateCompleted to todos so they're archived 3 days after

completion, not 3 days after creation. Fixes #2478
This commit is contained in:
Tyler Renelle
2014-01-19 17:12:18 -08:00
parent f4859daef1
commit b1afc177aa
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -15,7 +15,7 @@ var _ = require('lodash');
var TaskSchema = {
//_id:{type: String,'default': helpers.uuid},
id: {type: String,'default': shared.uuid},
created: {type:Date, 'default':new Date},
dateCreated: {type:Date, 'default':Date.now},
text: String,
notes: {type: String, 'default': ''},
tags: {type: Schema.Types.Mixed, 'default': {}}, //{ "4ddf03d9-54bd-41a3-b011-ca1f1d2e9371" : true },
@@ -73,6 +73,7 @@ var TodoSchema = new Schema(
_.defaults({
type: {type:String, 'default': 'todo'},
completed: {type: Boolean, 'default': false},
dateCompleted: Date,
date: String, // due date for todos // FIXME we're getting parse errors, people have stored as "today" and "3/13". Need to run a migration & put this back to type: Date
collapseChecklist:collapseChecklist,
checklist:checklist