2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

Time field added

This commit is contained in:
neel 2018-07-04 22:22:18 +05:30
parent 77964cae23
commit 58dc8bb94d
2 changed files with 48 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import Password from './Password';
import Select from './Select';
import Table from './Table';
import Text from './Text';
import Time from './Time'
export default {
props: ['docfield', 'value', 'onlyInput'],
@ -43,6 +44,7 @@ export default {
Select,
Table,
Text,
Time,
}[this.docfield.fieldtype];
}
}

View File

@ -0,0 +1,46 @@
<template>
<div class="form-group" v-if="!onlyInput">
<label>{{ docfield.label }}</label>
<flat-pickr
:value="value"
:config="config"
class="form-control"
@on-change="emitChange"
>
</flat-pickr>
</div>
<flat-pickr
v-else
:value="value"
:config="config"
class="form-control"
@on-change="emitChange"
>
</flat-pickr>
</template>
<script>
import flatPickr from 'vue-flatpickr-component';
import Data from './Data';
export default {
extends: Data,
data(){
return{
config:{
enableTime: true,
noCalendar: true
}
}
},
components: {
flatPickr
},
methods: {
emitChange(times, timeString) {
this.$emit('change', timeString);
}
}
};
</script>
<style lang="scss">
@import "flatpickr/dist/flatpickr.css";
</style>