Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Lionel Bijaoui committed Sep 20, 2016
1 parent bce9070 commit 4bc0601
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions src/fields/fieldInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,33 +34,34 @@
</template>

<script>
/* global moment */
import abstractField from "./abstractField";
export default {
mixins: [ abstractField ],
methods: {
formatValueToField(value) {
switch(this.schema.inputType){
case "date":
return moment(value).format("YYYY-MM-DD");
case "datetime":
return moment(value).format();
case "datetime-local":
return moment(value).format("YYYY-MM-DDTHH:mm:ss");
default:
return value;
case "date":
return moment(value).format("YYYY-MM-DD");
case "datetime":
return moment(value).format();
case "datetime-local":
return moment(value).format("YYYY-MM-DDTHH:mm:ss");
default:
return value;
}
},
formatValueToModel(value) {
console.log(this.schema.inputType, typeof value);
if (value != null) {
if (this.schema.inputType === "date" ||
this.schema.inputType === "datetime" ||
this.schema.inputType === "datetimelocal") {
if (this.schema.inputType === "date" ||
this.schema.inputType === "datetime" ||
this.schema.inputType === "datetimelocal") {
return new Date(value).getTime();
}else{
return value;
}
}else{
return value;
}
} else {
return value;
}
Expand Down

0 comments on commit 4bc0601

Please sign in to comment.