Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intervals with leap year dates return incorrect years #735

Open
emlautarom1 opened this issue Mar 13, 2024 · 0 comments
Open

Intervals with leap year dates return incorrect years #735

emlautarom1 opened this issue Mar 13, 2024 · 0 comments

Comments

@emlautarom1
Copy link
Contributor

This is a tricky issue that only showed up this year. In order to reproduce, you need to set up the reference date to something like refTime (2024, 2, 1, 4, 30, 0) (-3) in:

testContext :: Context
testContext = Context
{ locale = makeLocale EN Nothing
, referenceTime = refTime (2013, 2, 12, 4, 30, 0) (-2)
}

or using the reftime parameter in the POST request.

For example, the input February 4 - February 29 returns the interval from: 2023-02-04 00:00:00 -0300 to: 2024-02-29 00:00:00 -0300. Note how the starting date is in 2023 rather than in 2024.

If we change the input to February 4 - February 28, we get the interval from: 2024-02-04 00:00:00 -0300 to: 2024-02-29 00:00:00 -0300, which is correct.

The issue is also not present when using plain dates, ex. February 29 returns value: 2024-02-29 00:00:00 -0300

This issue is present in all languages that I've tried so far (EN, ES, DE), so it seems to be something related to how Duckling resolves dates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant