console
console copied to clipboard
🐛 Bug Report: wrong 'next execution' for scheduled functions
👟 Reproduction steps
- Create a function on any Appwrite project
- Access the newly created function settings and set it to run everyday at a given hour
- For example, everyday at 2AM using the CRON Expression
* 3 * * *
- For example, everyday at 2AM using the CRON Expression
- Access the functions dashboard
- Find the function you just created
- Using your mouse hover the "scheduled clock" icon
- Verify that that the
Next execution: ?is incorrect, e.g.: it saysNext execution: Mar 1, 2000, 00:00, instead of sayingNext execution: { today || tomorrow }, { year }, 03:00
👍 Expected behavior
It should display the correct date for the next execution:
0 1 * * * maps to Next execution: { today || tomorrow}, {year}, 01:00AM
0 2 * * * maps to Next execution: { today || tomorrow}, {year}, 02:00AM
0 3 * * * maps to Next execution: { today || tomorrow}, {year}, 03:00AM
👎 Actual Behavior
It displays the wrong date for the next execution:
0 1 * * * maps to Next execution: Jan 1, 2000, 00:00
0 2 * * * maps to Next execution: Feb 1, 2000, 00:00
0 3 * * * maps to Next execution: Mar 1, 2000, 00:00
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Something else
🧱 Your Environment
This issue can be replicated using only appwrite cloud without any other dependencies.
👀 Have you spent some time to check if this issue has been raised before?
- [X] I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
@FranciscoKloganB, thanks for creating this issue! 🙏 I have noticed some weird behavior with that. We'll have to look into it.
Some candidates for converting cron to human readable:
| Package | Stars | Size | Weekly Downloads |
|---|---|---|---|
| cronstrue | 1.2k | 1.14 MB | 788K |
| cron-parser | 1.3k | 54.2 KB | 2.9M |