mirror of
https://github.com/frappe/books.git
synced 2025-02-08 23:18:31 +00:00
Time field added
This commit is contained in:
parent
77964cae23
commit
58dc8bb94d
@ -22,6 +22,7 @@ import Password from './Password';
|
|||||||
import Select from './Select';
|
import Select from './Select';
|
||||||
import Table from './Table';
|
import Table from './Table';
|
||||||
import Text from './Text';
|
import Text from './Text';
|
||||||
|
import Time from './Time'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['docfield', 'value', 'onlyInput'],
|
props: ['docfield', 'value', 'onlyInput'],
|
||||||
@ -43,6 +44,7 @@ export default {
|
|||||||
Select,
|
Select,
|
||||||
Table,
|
Table,
|
||||||
Text,
|
Text,
|
||||||
|
Time,
|
||||||
}[this.docfield.fieldtype];
|
}[this.docfield.fieldtype];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
46
ui/components/controls/Time.vue
Normal file
46
ui/components/controls/Time.vue
Normal 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>
|
Loading…
x
Reference in New Issue
Block a user