diff --git a/web/src/components/CourseRedactor.vue b/web/src/components/CourseRedactor.vue
index eeecdea3..9335c864 100644
--- a/web/src/components/CourseRedactor.vue
+++ b/web/src/components/CourseRedactor.vue
@@ -115,10 +115,10 @@
-
-
-
-
+
@@ -850,15 +850,34 @@
schedule.then((response) => {
if (response.data) {
- this.scheduleOptions = _.orderBy(response.data.results.map((schedule) => {
- var now = new Date();
- now.setDate(now.getDate() + (schedule.weekday + (7 - now.getDay())) % 7);
- return {
- title: `${schedule.title} (${this.weekdays[schedule.weekday]}, ${moment(now).format("D MMM")})`,
+ let schedule = [];
+ response.data.results.forEach((item) => {
+ schedule[item.weekday] = item.title;
+ });
+
+ console.log('schedule', schedule);
+
+ let options = [];
+
+ for(let i=-7;i<=10;i++) {
+ let now = new Date();
+ now.setDate(now.getDate() + i);
+
+ let weekday = now.getDay() || 7;
+
+
+ console.log('data', i, now.getDay(), weekday, now, moment(now).format("D MMM"));
+
+ options.push({
+ title: `${schedule[weekday]} (${this.weekdays[weekday]}, ${moment(now).format("D MMM")})`,
value: moment(now).format('YYYY-MM-DD')
- }
- }), (item)=>{return moment(item.value)});
+ });
+ }
+
+ console.log('options',options);
+
+ this.scheduleOptions = _.orderBy(options, (item)=>{return moment(item.value)});
}
this.updateCategory();
});
diff --git a/web/src/components/inputs/LilSelect.vue b/web/src/components/inputs/LilSelect.vue
index 6845fece..7fd19d60 100644
--- a/web/src/components/inputs/LilSelect.vue
+++ b/web/src/components/inputs/LilSelect.vue
@@ -4,7 +4,7 @@
{{ selectedTitle }}