Skip to content

Commit

Permalink
handle null value
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Feb 14, 2017
1 parent dcaa273 commit 97213a8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/fields/fieldInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,17 @@
mixins: [ abstractField ],
methods: {
formatValueToField(value) {
switch(this.schema.inputType){
case "date":
return fecha.format(value, "YYYY-MM-DD");
case "datetime":
return fecha.format(value);
case "datetime-local":
return fecha.format(value, "YYYY-MM-DDTHH:mm:ss");
default:
return value;
if (value != null) {
switch(this.schema.inputType){
case "date":
return fecha.format(value, "YYYY-MM-DD");
case "datetime":
return fecha.format(value);
case "datetime-local":
return fecha.format(value, "YYYY-MM-DDTHH:mm:ss");
default:
return value;
}
}
},
formatValueToModel(value) {
Expand Down

0 comments on commit 97213a8

Please sign in to comment.