tags on create

This commit is contained in:
Kameron Kenny 2019-06-27 13:05:48 -04:00
parent debe736f78
commit f6623892f0
2 changed files with 19 additions and 2 deletions

View File

@ -460,7 +460,24 @@ getJson();
var nDateField = document.getElementById("timepickerCreate").value;
var notesField = document.getElementById("newNotes").value;
var newEventJson = { uuid: genUid(), nDate: nDateField, subject: subjectField, priority: priorityField, progress: progressField, notes: notesField };
var newTag = document.getElementById("tagsCreate").value.toLowerCase();
var stripLeadingSpace = newTag.replace(', ', ',');
var newTags = stripLeadingSpace.split(",");
// make sure tags object exists
/*
if (punchList[item].tags === undefined) {
console.log(`Adding tags object to punchList[${item}]`);
punchList[item].tags = [];
}
for ( nt = 0; nt < newTags.length; nt++ ) {
punchList[item].tags.push(newTags[nt]);
console.log(`${punchList[item].tags}`);
}
*/
var newEventJson = { uuid: genUid(), nDate: nDateField, subject: subjectField, priority: priorityField, progress: progressField, tags: newTags, notes: notesField };
punchList.push(newEventJson);
jsonStr = JSON.stringify(punchList);
putJson(jsonStr);

View File

@ -1,4 +1,4 @@
var version = "0.8.012",
var version = "0.8.032",
debug = false,
jsonUrl = "https://api.myjson.com/bins/1dodsj",
showDone = false,