File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 4343 mixins: [ abstractField ],
4444 methods: {
4545 formatValueToField (value ) {
46- if (typeof value === " undefined" ) {
47- return value;
48- } else {
46+ if (value != null ) {
4947 switch (this .schema .inputType ){
5048 case " date" :
5149 return fecha .format (value, " YYYY-MM-DD" );
5250 case " datetime" :
5351 return fecha .format (value, " YYYY-MM-DD HH:mm:ss" );
5452 case " datetime-local" :
5553 return fecha .format (value, " YYYY-MM-DDTHH:mm:ss" );
56- default :
57- return value;
5854 }
5955 }
56+
57+ return value;
6058 },
6159 formatValueToModel (value ) {
6260 if (value != null ) {
63- if (this .schema .inputType === " date" ||
64- this .schema .inputType === " datetime" ||
65- this .schema .inputType === " datetimelocal" ) {
66- return new Date (value).getTime ();
61+ switch (this .schema .inputType ){
62+ case " date" :
63+ return fecha .parse (value, " YYYY-MM-DD" );
64+ case " datetime" :
65+ return fecha .parse (value, " YYYY-MM-DD HH:mm:ss" );
66+ case " datetime-local" :
67+ return fecha .parse (value, " YYYY-MM-DDTHH:mm:ss" );
6768 }
6869 }
6970
You can’t perform that action at this time.
0 commit comments