date order fix

remotes/origin/hasaccess
Sanasol 8 years ago
parent 08a36ecec0
commit 1fd85690ac
  1. 4
      web/src/components/CourseRedactor.vue

@ -837,7 +837,7 @@
schedule.then((response) => { schedule.then((response) => {
if (response.data) { if (response.data) {
this.scheduleOptions = response.data.results.map((schedule) => { this.scheduleOptions = _.orderBy(response.data.results.map((schedule) => {
var now = new Date(); var now = new Date();
now.setDate(now.getDate() + (schedule.weekday + (7 - now.getDay())) % 7); now.setDate(now.getDate() + (schedule.weekday + (7 - now.getDay())) % 7);
@ -845,7 +845,7 @@
title: `${schedule.title} (${this.weekdays[schedule.weekday]}, ${moment(now).format("D MMM")})`, title: `${schedule.title} (${this.weekdays[schedule.weekday]}, ${moment(now).format("D MMM")})`,
value: moment(now).format('YYYY-MM-DD') value: moment(now).format('YYYY-MM-DD')
} }
}); }), (item)=>{return moment(item.value)});
} }
this.updateCategory(); this.updateCategory();
}); });

Loading…
Cancel
Save