mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-28 12:11:08 -04:00
Merge branch 'master' of https://gitlab.com/mohit.panjvani/crater-web into template-refactor
This commit is contained in:
@ -18,8 +18,6 @@
|
||||
import { mapGetters } from 'vuex'
|
||||
import SwDatePicker from '@bytefury/spacewind/src/components/SwDatePicker'
|
||||
import moment from 'moment'
|
||||
const fromMomentDate = (date, format = 'YYYY-MM-DD') =>
|
||||
moment(new Date(date), format)
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -78,9 +76,11 @@ export default {
|
||||
watch: {
|
||||
value(val) {
|
||||
if (val && !this.enableTime) {
|
||||
this.date = fromMomentDate(val, 'YYYY-MM-DD').format('YYYY-MM-DD')
|
||||
this.date = moment(new Date(val), 'YYYY-MM-DD').format('YYYY-MM-DD')
|
||||
} else {
|
||||
this.date = fromMomentDate(val, 'YYYY-MM-DD').format('YYYY-MM-DD H:m:s')
|
||||
this.date = moment(new Date(val), 'YYYY-MM-DD').format(
|
||||
'YYYY-MM-DD H:m:s'
|
||||
)
|
||||
}
|
||||
},
|
||||
enableTime(val) {
|
||||
@ -118,11 +118,13 @@ export default {
|
||||
)
|
||||
}
|
||||
if (this.value && !this.enableTime) {
|
||||
this.date = fromMomentDate(this.value, 'YYYY-MM-DD').format('YYYY-MM-DD')
|
||||
this.date = moment(new Date(this.value), 'YYYY-MM-DD').format(
|
||||
'YYYY-MM-DD'
|
||||
)
|
||||
return true
|
||||
}
|
||||
if (this.value) {
|
||||
this.date = fromMomentDate(this.value, 'YYYY-MM-DD').format(
|
||||
this.date = moment(new Date(this.value), 'YYYY-MM-DD').format(
|
||||
'YYYY-MM-DD HH:mm:SS'
|
||||
)
|
||||
}
|
||||
@ -130,7 +132,6 @@ export default {
|
||||
methods: {
|
||||
onDateChange(date) {
|
||||
this.$emit('input', date)
|
||||
this.$emit('change', date)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user