-
Notifications
You must be signed in to change notification settings - Fork 139
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
Persian Calendar to parse CRON expressions #44
Comments
No in the current version.
It could certainly be implemented but it would be best if it's spec'd out by someone who understands the intricate details of the Persian calendar. I certainly don't have the knowledge. Even if this project adds support, it doesn't guarantee that Hangfire will. |
Thanks a lot. |
Two problems:
You can help with 1 by explaining what the expectation is (e.g. do you expect to use English names for Persian months and week days?) and adding unit tests that would fail, showing lack of support, and which then one could go about fixing. In case you want to do a spike, the NCrontab calendar is fixed here in NCrontab/NCrontab/CrontabSchedule.cs Line 399 in 26c223f
It is then used in two places to get the maximum supported year: NCrontab/NCrontab/CrontabSchedule.cs Lines 325 to 331 in 26c223f
and the days in a month: NCrontab/NCrontab/CrontabSchedule.cs Lines 352 to 359 in 26c223f
Without any design work, the first thing would be to see if replacing the invariant culture calendar with the Persian one passes the unit tests based on the Persian calendar. Then, the month and week day names are hard-wired in English in NCrontab/NCrontab/CrontabFieldImpl.cs Lines 43 to 44 in 26c223f
My guess is therefore that these area will need to be somehow made configurable to support an alternative calendar. The Persian calendar seems (from what I read up quickly) quite straightforward in that it has 12 months and 365 days so I don't anticipate too many issues (though I might be underestimating the effort given my lack of knowledge). |
I review source code yesterday and find static calendar instance that all calculation are done by it. I think Calendar instance must be a culture specific calendar like it: |
Hi all,
I want to run recurring task in Hangfire by CRON expression like (* 10 1 * * ) to run at 10 of first day of month, But I want to run first day of persian calendar month(Farvardin,Ordibehesht,…).
Hangfire use NCrontab to parse CRON expressions.
Is it possible to change locale or calendar or implement any to support it?
The text was updated successfully, but these errors were encountered: