|
|
|
|
@ -115,10 +115,10 @@ |
|
|
|
|
<button disabled class="field__append">руб.</button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<!--<label v-if="!live" class="info__switch switch switch_lg">--> |
|
|
|
|
<!--<input type="checkbox" class="switch__input" v-model="course.is_featured">--> |
|
|
|
|
<!--<span class="switch__content">Выделить</span>--> |
|
|
|
|
<!--</label>--> |
|
|
|
|
<label v-if="!live && me.role === ROLE_ADMIN" class="info__switch switch switch_lg"> |
|
|
|
|
<input type="checkbox" class="switch__input" v-model="course.is_featured"> |
|
|
|
|
<span class="switch__content">Выделить</span> |
|
|
|
|
</label> |
|
|
|
|
</div> |
|
|
|
|
<div v-if="!live" class="info__fieldset"> |
|
|
|
|
<div class="info__field field"> |
|
|
|
|
@ -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(); |
|
|
|
|
}); |
|
|
|
|
|