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

Commit

Permalink
handle keyword 'weekday' for Issue #107
Browse files Browse the repository at this point in the history
  • Loading branch information
scottleedavis committed May 25, 2019
1 parent 0aff715 commit 1e61264
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@
"id": "tomorrow",
"translation": "tomorrow"
},
{
"id": "weekday",
"translation": "weekday"
},
{
"id": "weekdays",
"translation": "weekdays"
},
{
"id": "mon",
"translation": "mon"
Expand Down
3 changes: 3 additions & 0 deletions server/occurrence.go
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,9 @@ func (p *Plugin) everyEN(when string, user *model.User) (times []time.Time, err
chronoTime = strings.Trim(dateTimeSplit[1], " ")
}

if chronoDate == T("weekday") || chronoDate == T("weekdays") {
chronoDate = T("monday") + "," + T("tuesday") + "," + T("wednesday") + "," + T("thursday") + "," + T("friday")
}
days := p.regSplit(chronoDate, "("+T("and")+")|(,)")

for _, chrono := range days {
Expand Down

0 comments on commit 1e61264

Please sign in to comment.