maennchen / crontab

Parse Cron Expressions, Compose Cron Expression Strings and Caluclate Execution Dates.
https://hex.pm/packages/crontab
MIT License
91 stars 32 forks source link

Human-readable crons? #130

Open egeersoz opened 6 months ago

egeersoz commented 6 months ago

Can support be added to convert Crons to human-readable strings? e.g. "Every Sunday at 6:00PM"

Ideally, this should also work with different timezones, e.g. you should be able to specify the timezone of the cron, and the target, e.g. if the Cron is UTC and you want it displayed in CST, it should be possible to do so.

maennchen commented 6 months ago

Are you asking to convert text to cron expressions or the other way around?

Converting text to cron expression sounds quite complicated and I‘m not sure if that would have a place in this library.

Converting cron to text should be a lot simpler and could help users understand their expressions.

In either case, I‘m open to explore the possibility, but will not have the time to do so myself. If you‘d like to explore this, you‘d have to document the desired and detailed behaviour theoretically and also be willing to provide a PR later.

What use case do you have for this feature?

egeersoz commented 6 months ago

Need to be able to convert cron expressions to human-readable strings. Basically, what Crontab.guru does.