Fix repeater type.

I had Cumulative and CatchUp backwards.
This commit is contained in:
Tom Alexander 2023-10-02 19:18:25 -04:00
parent bc3224be7a
commit 5c929ffc13
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,7 @@
# All the marks for repeater and warning delay
[1970-01-01 Thu 8:15-13:15foo +1h -2h]
[1970-01-01 Thu 8:15-13:15foo ++1d -2d]
[1970-01-01 Thu 8:15-13:15foo .+1w -2w]
[1970-01-01 Thu 8:15-13:15foo +1m --2m]
[1970-01-01 Thu 8:15-13:15foo ++1y --2y]
[1970-01-01 Thu 8:15-13:15foo .+1d --2h]

View File

@ -534,8 +534,8 @@ fn repeater<'b, 'g, 'r, 's>(
// ++ for catch-up type
// .+ for restart type
let (remaining, repeater_type) = alt((
map(tag("++"), |_| RepeaterType::Cumulative),
map(tag("+"), |_| RepeaterType::CatchUp),
map(tag("++"), |_| RepeaterType::CatchUp),
map(tag("+"), |_| RepeaterType::Cumulative),
map(tag(".+"), |_| RepeaterType::Restart),
))(input)?;
let (remaining, value) = digit1(remaining)?;