mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix bug display current openingDate in datepicker
This commit is contained in:
parent
cb17a7e8a5
commit
fe4eaa92be
@ -17,7 +17,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { datetimeToISO, ISOToDate} from 'ChillMainAssets/chill/js/date.js';
|
||||
import { datetimeToISO, dateToISO, ISOToDate, ISOToDatetime} from 'ChillMainAssets/chill/js/date.js';
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
|
||||
export default {
|
||||
@ -37,13 +37,14 @@ export default {
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
startDate() {
|
||||
console.log(datetimeToISO(this.$store.state.accompanyingCourse.openingDate))
|
||||
return datetimeToISO(this.$store.state.accompanyingCourse.openingDate)
|
||||
}
|
||||
// ...mapState({
|
||||
// startDate: state => dateToISO(state.accompanyingCourse.openingDate)
|
||||
// })
|
||||
// startDate() {
|
||||
// const date = ISOToDatetime(this.$store.state.accompanyingCourse.openingDate.datetime)
|
||||
// console.log(dateToISO(date))
|
||||
// // return datetimeToISO(this.$store.state.accompanyingCourse.openingDate)
|
||||
// }
|
||||
...mapState({
|
||||
startDate: state => dateToISO(ISOToDatetime(state.accompanyingCourse.openingDate.datetime))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
},
|
||||
updateStartDate(state, date) {
|
||||
console.log('new state date', date)
|
||||
state.accompanyingCourse.openingDate.datetime = date;
|
||||
state.accompanyingCourse.openingDate = date;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
@ -714,7 +714,7 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
||||
console.log('body', body)
|
||||
return makeFetch('PATCH', url, body)
|
||||
.then((response) => {
|
||||
commit('updateStartDate', ISOToDatetime(response.openingDate.datetime));
|
||||
commit('updateStartDate', response.openingDate);
|
||||
})
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
|
Loading…
x
Reference in New Issue
Block a user