mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
fix datepicker for householdmember editor
This commit is contained in:
parent
66ab38c60f
commit
de9d2aa885
@ -66,18 +66,19 @@ export default {
|
||||
},
|
||||
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('-');
|
||||
return this.$store.state.startDate;
|
||||
// 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);
|
||||
// let
|
||||
// [year, month, day] = value.split('-'),
|
||||
// dValue = new Date(year, month-1, day);
|
||||
|
||||
this.$store.dispatch('setStartDate', dValue);
|
||||
this.$store.dispatch('setStartDate', value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import { createStore } from 'vuex';
|
||||
import { householdMove, fetchHouseholdSuggestionByAccompanyingPeriod, fetchAddressSuggestionByPerson} from './../api.js';
|
||||
import { fetchResults } from 'ChillMainAssets/lib/api/apiMethods.js'
|
||||
import { fetchHouseholdByAddressReference } from 'ChillPersonAssets/lib/household.js';
|
||||
import { datetimeToISO } from 'ChillMainAssets/chill/js/date.js';
|
||||
import { datetimeToISO, dateToISO, ISOToDate } from 'ChillMainAssets/chill/js/date.js';
|
||||
|
||||
const debug = process.env.NODE_ENV !== 'production';
|
||||
|
||||
@ -30,7 +30,7 @@ const store = createStore({
|
||||
}
|
||||
return 0;
|
||||
}),
|
||||
startDate: new Date(),
|
||||
startDate: dateToISO(new Date()),
|
||||
/**
|
||||
* Indicates if the destination is:
|
||||
*
|
||||
@ -278,7 +278,7 @@ const store = createStore({
|
||||
type: conc.person.type
|
||||
},
|
||||
start_date: {
|
||||
datetime: datetimeToISO(state.startDate)
|
||||
datetime: datetimeToISO(ISOToDate(state.startDate))
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user