This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user