Skip to content

Commit

Permalink
Merge pull request #9 from gersonmontenegro/stage
Browse files Browse the repository at this point in the history
fix: Go to today's lesson when press Read
  • Loading branch information
VitalikL authored May 11, 2024
2 parents a283537 + 378bcfa commit fbaa57c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/views/Lessons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ 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 = DayJS(x.start_date, "DD/MM/YYYY").startOf("day")
let endDate = DayJS(x.end_date, "DD/MM/YYYY").endOf("day")
let startDate = x.start_date
let endDate = x.end_date
return DayJS(now).isBetween(startDate, endDate, "day")
}) || this.quarterly.lessons[0]
return `/${this.$route.params.lang}/${this.$route.params.quarter}/${lesson.id}`
}
},
Expand Down

0 comments on commit fbaa57c

Please sign in to comment.