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>
|
<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';
|
import { mapState, mapGetters } from 'vuex';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -37,13 +37,14 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
startDate() {
|
// startDate() {
|
||||||
console.log(datetimeToISO(this.$store.state.accompanyingCourse.openingDate))
|
// const date = ISOToDatetime(this.$store.state.accompanyingCourse.openingDate.datetime)
|
||||||
return datetimeToISO(this.$store.state.accompanyingCourse.openingDate)
|
// console.log(dateToISO(date))
|
||||||
}
|
// // return datetimeToISO(this.$store.state.accompanyingCourse.openingDate)
|
||||||
// ...mapState({
|
// }
|
||||||
// startDate: state => dateToISO(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) {
|
updateStartDate(state, date) {
|
||||||
console.log('new state date', date)
|
console.log('new state date', date)
|
||||||
state.accompanyingCourse.openingDate.datetime = date;
|
state.accompanyingCourse.openingDate = date;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
@ -714,7 +714,7 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
|||||||
console.log('body', body)
|
console.log('body', body)
|
||||||
return makeFetch('PATCH', url, body)
|
return makeFetch('PATCH', url, body)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
commit('updateStartDate', ISOToDatetime(response.openingDate.datetime));
|
commit('updateStartDate', response.openingDate);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
commit('catchError', error);
|
commit('catchError', error);
|
||||||
@ -726,10 +726,10 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
|
|||||||
commit('setReferrersSuggested', users);
|
commit('setReferrersSuggested', users);
|
||||||
commit('setFilteredReferrersSuggested');
|
commit('setFilteredReferrersSuggested');
|
||||||
if (
|
if (
|
||||||
null === state.accompanyingCourse.user
|
null === state.accompanyingCourse.user
|
||||||
&& !state.accompanyingCourse.confidential
|
&& !state.accompanyingCourse.confidential
|
||||||
&& !state.accompanyingCourse.step === 'DRAFT'
|
&& !state.accompanyingCourse.step === 'DRAFT'
|
||||||
&& users.length === 1
|
&& users.length === 1
|
||||||
) {
|
) {
|
||||||
// set the user if unique
|
// set the user if unique
|
||||||
commit('updateReferrer', users[0]);
|
commit('updateReferrer', users[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user