From 1fd85690ac76ae23ba02ba33cfa0b4b45f29c682 Mon Sep 17 00:00:00 2001 From: Sanasol Date: Thu, 26 Apr 2018 12:21:10 +0300 Subject: [PATCH] date order fix --- web/src/components/CourseRedactor.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/CourseRedactor.vue b/web/src/components/CourseRedactor.vue index 5c9106fc..7e1cca55 100644 --- a/web/src/components/CourseRedactor.vue +++ b/web/src/components/CourseRedactor.vue @@ -837,7 +837,7 @@ schedule.then((response) => { if (response.data) { - this.scheduleOptions = response.data.results.map((schedule) => { + this.scheduleOptions = _.orderBy(response.data.results.map((schedule) => { var now = new Date(); 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")})`, value: moment(now).format('YYYY-MM-DD') } - }); + }), (item)=>{return moment(item.value)}); } this.updateCategory(); });