Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
Chooses next next instead of next week. Issue #78
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleedavis committed May 1, 2019
1 parent e695021 commit c82106b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/occurrence.go
Original file line number Diff line number Diff line change
Expand Up @@ -806,8 +806,10 @@ func (p *Plugin) onEN(when string, user *model.User) (times []time.Time, err err

if weekDayNum < todayWeekDayNum {
day = 7 - (todayWeekDayNum - weekDayNum)
} else if weekDayNum >= todayWeekDayNum {
} else if weekDayNum == todayWeekDayNum {
day = 7 + (weekDayNum - todayWeekDayNum)
} else {
day = (weekDayNum - todayWeekDayNum)
}

timeUnitSplit := strings.Split(timeUnit, ":")
Expand Down Expand Up @@ -972,8 +974,10 @@ func (p *Plugin) everyEN(when string, user *model.User) (times []time.Time, err

if weekDayNum < todayWeekDayNum {
day = 7 - (todayWeekDayNum - weekDayNum)
} else if weekDayNum >= todayWeekDayNum {
} else if weekDayNum == todayWeekDayNum {
day = 7 + (weekDayNum - todayWeekDayNum)
} else {
day = (weekDayNum - todayWeekDayNum)
}

timeUnitSplit := strings.Split(timeUnit, ":")
Expand Down

0 comments on commit c82106b

Please sign in to comment.