moved the insert date to occur only when the task is new and not being modified

This commit is contained in:
Morgan McMillian 2012-11-09 22:43:26 -05:00
parent 1b88123de6
commit 9917680c13
3 changed files with 6 additions and 6 deletions

View file

@ -1,6 +1,6 @@
{
"id": "com.monkeystew.todotxtenyo.beta",
"version": "0.2.1",
"version": "0.2.2",
"vendor": "Monkeystew",
"type": "web",
"main": "index.html",

View file

@ -261,10 +261,6 @@ enyo.kind({
task.pri = null;
task.detail = this.owner.$.editView.$.tododetail.getValue();
task.detail = task.detail.replace(/(<\/?[A-Za-z][A-Za-z0-9]*>)+/g," ");
if (this.owner.preferences["dateTasks"] && !this.completeItem) {
var dfmt = new enyo.g11n.DateFmt({date:"yyyy-MM-dd"});
task.detail = dfmt.format(new Date()) + " " + task.detail;
}
if (this.owner.preferences["storage"] != "none" && this.cacheChanges != "YES" && this.cacheChanges != "COMMIT") {
console.log("saving backup");
this.owner.saveFile(
@ -278,6 +274,10 @@ enyo.kind({
this.owner.todoList[this.selectedId].pri = task.detail.match(/^\([A-E]\)\s/);
this.replaceItem = false;
} else {
if (this.owner.preferences["dateTasks"] && !this.completeItem) {
var dfmt = new enyo.g11n.DateFmt({date:"yyyy-MM-dd"});
task.detail = dfmt.format(new Date()) + " " + task.detail;
}
this.owner.todoList.push(task);
}
this.listRefresh();

View file

@ -3,7 +3,7 @@
"package_format_version": 2,
"loc_name": "Todo.txt Enyo",
"icon": "icon.png",
"version": "0.2.1",
"version": "0.2.2",
"vendor": "Monkeystew",
"app": "com.monkeystew.todotxtenyo.beta",
"services": ["com.monkeystew.todotxtenyo.beta.service"]