Closed Nek-12 closed 1 year ago
You may want to start writing tests since the library has 380 stars now.
Tests exist for each module except for the date-time module due to a limitation. My free time is limited. Feel free to contribute changes. This could have been fixed quicker than writing this issue. When I have more free time, I will expand the current test cases and add date-time test.
To be honest, I wanted to open a pr, but struggled to understand the codebase. It's quick for you, but I've spent about an hour trying to figure the source of an issue. But if I find a possible improvement, for example, regarding my other issue, I'll open a pr. Please don't take this as an accusation
There is only one location where the initial date and time is being used to calculate something. Your guess was correct, as the offset was wrong for selecting the corresponding value option by index, due to the day and month starting from 0.
Can you please publish a version with this change included when you have free time?
@maxkeppeler Friendly bump. No one can publish a version except you
A datetime dialog defined as following
When shown, starts with month and day values incremented by one.
For example, a value of 5/9/23 (verified as being correct) when passed to the dialog, upon opening, shows that the selected date is "Jun 10 2023" which means that the day and month values are bigger than the actual ones by one. Clicking "OK" without changing anything updates values to correct ones, but reopening the dialog results in another increment, and this can be repeated indefinitely. After reaching month 12, the dialog displays the month value as unset. Clicking "OK" will crash the app.
Stacktrace
I suppose the error is that the month and day selection starts from 1, not zero :D