diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index aacd3054..4e822f4c 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -16,7 +16,7 @@ TODO CLIENT STUFF DATETIME - DONE Wrap the date picker to work with our dates without losing time. -- Wrap a time picker to work with our dates without losing the date. +- DONE Wrap a time picker to work with our dates without losing the date. - Once this is done then combine them into a single component that: -wraps both pickers as buttons to trigger selection on either side of a text that displays read only the locale formatted dt - single read only text field with initial display of date and time in users's locale format diff --git a/ayanova/src/components/gztimepicker.vue b/ayanova/src/components/gztimepicker.vue index d0e497dc..a4ee6020 100644 --- a/ayanova/src/components/gztimepicker.vue +++ b/ayanova/src/components/gztimepicker.vue @@ -28,10 +28,15 @@ export default { //Put back the time portion from before var combinedDateAndTimeAsString = that.value.substr(0, 11) + time; + //=========================================== + //PARSE THE TIME AND DATE + //NOTE: FOLLOWING CODE ADAPTED FROM A LIBRARY: + //https://github.com/csnover/js-iso8601 + //Only change is to make it a local function and move "numericKeys" variable into the code block var timestamp, struct, minutesOffset = 0, - numericKeys = [ 1, 4, 5, 6, 7, 10, 11 ]; + numericKeys = [1, 4, 5, 6, 7, 10, 11]; // ES5 §15.9.4.2 states that the string should attempt to be parsed as a Date Time String Format string // before falling back to any implementation-specific date parsing, so that’s what we do, even if native @@ -71,12 +76,9 @@ export default { } else { timestamp = Date.parse(combinedDateAndTimeAsString); } + //========================================== var newDateAsString = new Date(timestamp).toISOString(); - - // var dateObjectFromString = new Date(combinedDateAndTimeAsString); - // var newDateAsString = dateObjectFromString.toISOString(); - that.$emit("input", newDateAsString); } } diff --git a/ayanova/src/views/inventory-widget-edit.vue b/ayanova/src/views/inventory-widget-edit.vue index f8bc7f78..d6e23d0c 100644 --- a/ayanova/src/views/inventory-widget-edit.vue +++ b/ayanova/src/views/inventory-widget-edit.vue @@ -49,10 +49,10 @@ > - +
{{obj.startDate}}