Skip to content

Commit

Permalink
Merge pull request #10 from gersonmontenegro/fix/GoToTodaysLesson
Browse files Browse the repository at this point in the history
fix: Go to today's lesson when press Read. Rollback and improve isBet…
  • Loading branch information
VitalikL authored Aug 21, 2024
2 parents fbaa57c + ddb677a commit d59a310
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/views/Lessons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ export default {
if (!this.quarterly || !this.quarterly.lessons.length) { return null }
let now = DayJS().startOf("day")
let lesson = this.quarterly.lessons.find(x => {
let startDate = x.start_date
let endDate = x.end_date
return DayJS(now).isBetween(startDate, endDate, "day")
let startDate = DayJS(x.start_date, "DD/MM/YYYY").startOf("day")
let endDate = DayJS(x.end_date, "DD/MM/YYYY").endOf("day")
return DayJS(now).isBetween(startDate, endDate, null, '[]')
}) || this.quarterly.lessons[0]
return `/${this.$route.params.lang}/${this.$route.params.quarter}/${lesson.id}`
}
Expand Down

0 comments on commit d59a310

Please sign in to comment.