This commit is contained in:
2019-03-04 21:47:47 +00:00
parent 4135950055
commit ea24d476f6
3 changed files with 10 additions and 8 deletions

View File

@@ -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

View File

@@ -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 thats 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);
}
}

View File

@@ -49,10 +49,10 @@
></v-text-field>
</v-flex>
<!-- <v-flex xs12 sm6 lg4 xl3 px-2>
<v-flex xs12 sm6 lg4 xl3 px-2>
<div>{{obj.startDate}}</div>
<gz-date-picker label="TESTStartDate" v-model="obj.startDate"></gz-date-picker>
</v-flex> -->
</v-flex>
<v-flex xs12 sm6 lg4 xl3 px-2>
<div>{{obj.startDate}}</div>