fix datepicker for social action

This commit is contained in:
Julie Lenaerts 2022-04-05 15:56:02 +02:00
parent 8512a5e1bc
commit 8882c99f5a
2 changed files with 8 additions and 8 deletions

View File

@ -227,19 +227,18 @@ export default {
},
startDate: {
get() {
let d = this.$store.state.startDate;
return dateToISO(d);
return this.$store.state.startDate;
},
set(value) {
this.$store.commit('setStartDate', ISOToDate(value));
this.$store.commit('setStartDate', value);
}
},
endDate: {
get() {
return dateToISO(this.$store.state.endDate);
return this.$store.state.endDate;
},
set(value) {
this.$store.commit('setEndDate', ISOToDate(value));
this.$store.commit('setEndDate', value);
}
},
setSocialIssue: {

View File

@ -1,6 +1,6 @@
import { createStore } from 'vuex';
import { datetimeToISO } from 'ChillMainAssets/chill/js/date.js';
import { datetimeToISO, dateToISO, ISOToDate, ISOToDatetime } from 'ChillMainAssets/chill/js/date.js';
import { findSocialActionsBySocialIssue } from 'ChillPersonAssets/vuejs/_api/SocialWorkSocialAction.js';
// import { create } from 'ChillPersonAssets/vuejs/_api/AccompanyingCourseWork.js';
import { makeFetch } from 'ChillMainAssets/lib/api/apiMethods';
@ -47,7 +47,7 @@ const store = createStore({
id: state.socialActionPicked.id
},
startDate: {
datetime: datetimeToISO(state.startDate)
datetime: datetimeToISO(ISOToDate(state.startDate))
},
persons: []
};
@ -61,7 +61,7 @@ const store = createStore({
if (null !== state.endDate) {
payload.endDate = {
datetime: datetimeToISO(state.endDate)
datetime: datetimeToISO(ISOToDate(state.endDate))
};
}
@ -111,6 +111,7 @@ const store = createStore({
state.startDate = date;
},
setEndDate(state, date) {
console.log(date)
state.endDate = date;
},
setPersonsPickedIds(state, ids) {