sojinantony01 / react-cron-generator

Simple react component to generate cron expressions
MIT License
78 stars 62 forks source link

Inquiry About Generating 6-Field Cron Expressions #63

Open wsebapple opened 1 month ago

wsebapple commented 1 month ago

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,

sojinantony01 commented 1 month ago

@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!