File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/dispatch/static/dispatch/src/components Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,15 @@ let today = function () {
5252
5353const DATE_FORMAT = " yyyy-MM-dd"
5454
55+ function convertStringToDate (value ) {
56+ let parts = value .split (" -" )
57+ let year = parseInt (parts[0 ], 10 )
58+ let month = parseInt (parts[1 ], 10 ) - 1
59+ let day = parseInt (parts[2 ], 10 )
60+
61+ return new Date (year, month, day)
62+ }
63+
5564export default {
5665 name: " DateWindowInput" ,
5766 inheritAttrs: false ,
@@ -115,10 +124,10 @@ export default {
115124
116125 created () {
117126 if (this .modelValue .start ) {
118- this .start = new Date (this .modelValue .start )
127+ this .start = convertStringToDate (this .modelValue .start )
119128 }
120129 if (this .modelValue .end ) {
121- this .end = new Date (this .modelValue .end )
130+ this .end = convertStringToDate (this .modelValue .end )
122131 }
123132 },
124133
You can’t perform that action at this time.
0 commit comments