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