tags on create
This commit is contained in:
parent
debe736f78
commit
f6623892f0
|
@ -460,7 +460,24 @@ getJson();
|
||||||
var nDateField = document.getElementById("timepickerCreate").value;
|
var nDateField = document.getElementById("timepickerCreate").value;
|
||||||
var notesField = document.getElementById("newNotes").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);
|
punchList.push(newEventJson);
|
||||||
jsonStr = JSON.stringify(punchList);
|
jsonStr = JSON.stringify(punchList);
|
||||||
putJson(jsonStr);
|
putJson(jsonStr);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
var version = "0.8.012",
|
var version = "0.8.032",
|
||||||
debug = false,
|
debug = false,
|
||||||
jsonUrl = "https://api.myjson.com/bins/1dodsj",
|
jsonUrl = "https://api.myjson.com/bins/1dodsj",
|
||||||
showDone = false,
|
showDone = false,
|
||||||
|
|
Loading…
Reference in New Issue