-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Daily cron expression with timezone offset displays incorrect day #313
Comments
Isn't this correct? With |
Sorry, expected and actual should be switched in places, I've updated the description. The time is expected to move to next day, but cRonstrue returns the same day, despite the offset. |
Also for a negative |
@maxtwardowski - Do you think changes in #296 need to be tweaked for this case? |
Hi @bradymholt, I just started using this package (tyvm for building it!) this week and noticed this same issue. I wrote some test that I think would need to pass in order for this issue to be resolved.
I went to try making the code change but noticed there are some special day-of-month cases (like L, WL, and LW), and wasn't sure how it would need to fit in with those cases. |
As I think about it more, it probably needs to wrap the L day of the month forward to 1 if the tzOffset pushes over the dateline. Ie, if L is converted to the day before the last day, then it should remain as the Last day. But if L is converted to the day after the last day then it should write 'day 1 of the month'. Or as tests:
|
First, very useful package, keep up the good work! Second, here are a couple more examples. Along with the day of the month as previously mentioned, the month also doesn't wrap correctly.
Should be Jan 1st
Should be Dec 31st. Best! |
Cron Expression
0 20 28 * *
with atzOffset
set to5
Expected Output
"At 01:00 AM, on day 29 of the month"
Actual Output
"At 01:00 AM, on day 28 of the month"
Prerequisites
The text was updated successfully, but these errors were encountered: