mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 01:25:00 +00:00
add date for movement editor
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<h2>{{ $t('household_member_editor.dates_title') }}</h2>
|
||||
|
||||
<p>
|
||||
<label for="start_date">
|
||||
{{ $t('household_member_editor.dates.start_date') }}
|
||||
</label>
|
||||
<input type="date" v-model="startDate" />
|
||||
</p>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: 'Dates',
|
||||
computed: {
|
||||
startDate: {
|
||||
get() {
|
||||
return [
|
||||
this.$store.state.startDate.getFullYear(),
|
||||
(this.$store.state.startDate.getMonth() + 1).toString().padStart(2, '0'),
|
||||
this.$store.state.startDate.getDate().toString().padStart(2, '0')
|
||||
].join('-');
|
||||
},
|
||||
set(value) {
|
||||
let
|
||||
[year, month, day] = value.split('-'),
|
||||
dValue = new Date(year, month-1, day);
|
||||
|
||||
this.$store.dispatch('setStartDate', dValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
Reference in New Issue
Block a user