react-cron-generator icon indicating copy to clipboard operation
react-cron-generator copied to clipboard

Inquiry About Generating 6-Field Cron Expressions

Open wsebapple opened this issue 1 year ago • 6 comments

Hello,

I am using your react-cron-generator library and I appreciate your work on this project. Currently, the library generates a 7-field cron expression, including the seconds field. However, I need to generate a 6-field cron expression without the seconds field.

Is there an option or configuration in your library that allows generating 6-field cron expressions? If not, could you guide me on how to modify the code to achieve this?

Thank you for your assistance.

Best regards,

wsebapple avatar Jun 05 '24 10:06 wsebapple

@wsebapple Thanks for using the package. You can remove the first value from 7 cron values the first one refers to seconds. value.substring(2, value.length), But don't do this in onchange function!. do it when you are saving it!.

But, as of now generator is only accepting 7 cron values. I will try to update the package very soon.

Also found a bug - https://github.com/sojinantony01/react-cron-generator/blob/master/src/lib/cron.tsx#L43 when trying to parse 6 value cron to 7 value. it is adding year instead of seconds!

sojinantony01 avatar Jun 06 '24 18:06 sojinantony01

@sojinantony01 Hello, can this feature be supported? Adapt and generate spring java cron expressions.

Thank you very much

Best regards,

zyclove avatar Jul 26 '24 04:07 zyclove

6 value cron expressions are already supported as input, but when you are reading it back it will be 7 value cron. but you can convert it as i mentioned above.

You can remove the first value from 7 cron values the first one refers to seconds. value.substring(2, value.length),

SojinAntony avatar Jul 28 '24 13:07 SojinAntony

image

https://sojinantony01.github.io/react-cron-generator/

result: 0 0 00 L-2 1/1 ? *

https://tool.lu/crontab/

but, it is error. image

image

image

image

@SojinAntony @sojinantony01

zyclove avatar Jul 29 '24 01:07 zyclove

@zyclove But, in few other websites the expression is valid Eg: https://crontab.cronhub.io/ , http://www.cronmaker.com/?1 0 0 00 L-2 1/1 ? * - 7 cron 0 0 00 L-2 1/1 ? - 6 cron both are showing as valid

sojinantony01 avatar Jul 29 '24 06:07 sojinantony01

This seems to generate Quartz cron expressions ? So it doesn't work on UNIX ?

10YAR avatar Nov 07 '24 22:11 10YAR