Add support for daily, weekly, monthly, yearly recurrence patterns
Previously, only numeric forms (1d, 1w, 1m, 1y) and plural word forms (days, weeks, months, years) were supported for recurrence patterns. The common adverbial forms (daily, weekly, monthly, yearly) would fail with 'invalid recurrence pattern' error. Now users can use natural language recurrence patterns: - recur:daily -> 1 day interval - recur:weekly -> 7 day interval - recur:monthly -> 30 day interval - recur:yearly -> 365 day interval Added test coverage for all four new patterns.
This commit is contained in:
@@ -18,6 +18,11 @@ func TestParseRecurrencePattern(t *testing.T) {
|
||||
{"2w", 14 * 24 * time.Hour},
|
||||
{"1m", 30 * 24 * time.Hour},
|
||||
{"1y", 365 * 24 * time.Hour},
|
||||
// Test word forms
|
||||
{"daily", 24 * time.Hour},
|
||||
{"weekly", 7 * 24 * time.Hour},
|
||||
{"monthly", 30 * 24 * time.Hour},
|
||||
{"yearly", 365 * 24 * time.Hour},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
||||
Reference in New Issue
Block a user