Closed millotp closed 1 year ago
thanks for ticket. 00 is wrong, no? i think 00 should be KO right away with error
It seems to work fine on crontab.guru and other website, in fact they accept any number of 0
If you want IsValid
to be false for that case I can open a PR if you want
yep, but what does the spec say? i dont know, need to look that up lol :D if 00 is equivalent to 0 then we can do so as per specification. if not we can error :)
According to most resources, leading zero are allowed but not required:
Leading zeros can be used, but they are not required and have no impact on the cron expression's validity. For instance, 05, 5, and 0005 are all equivalent and valid for the minute field. The same applies to other fields as well
so I guess it's up to you 🤷♂️
thanks it is more upto spec i think. :) i would appreciate a PR allowing 00. 👍
(it was late yesterday in my timezone)
Hi,
I encountered a weird situation where
IsValid("00 * * * *")
istrue
andNextTick("00 * * * *", false)
fails with the errortried so hard
, but it works fine withNextTick("0 * * * *", false)
(it's the same with
00
in the hour segment)I'm not sure which scenario is correct, because some cron validator online says this is valid and other don't, so should
IsValid
return true or shouldNextTick
work with this expression ? Thanks !