Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inability to Edit Weekly Cron for Every Day of the Week in react-js-cron #62

Open
Gunjansokal07 opened this issue Oct 26, 2023 · 6 comments
Labels
bug Something isn't working PR welcome You can open a PR for this issue

Comments

@Gunjansokal07
Copy link

Description:

I am utilizing the react-js-cron to create weekly cron expressions. However, when attempting to edit a cron expression for all days of the week, the editor automatically switches to a daily mode. Specifically, when I input a weekly cron expression for every day of the week, such as '10 10 * * *,' the editor incorrectly converts it to a daily cron format.

Here are the steps to reproduce the issue, broken down point by point:

  1. Select the "Weekly" cron option.
  2. Leave the "Day of the Week" setting as "Every Day."
  3. Choose specific "Hour" and "Minute" values.
  4. The resulting cron expression will be "10 10 * * *."
  5. After saving this cron expression, when you attempt to edit it,
  6. The editor incorrectly converts the default "Weekly" dropdown option to "Daily."
  7. The "Hour" and "Minute" values are retained from the previous input.

Versions (please complete the following information):

  • react-js-cron version - 4.1.0
  • React version: 18.2.0
@xrutayisire
Copy link
Owner

Hi,

If I understood your use case, it's normal.

10 10 * * * means every day of the week at 10:10, right?
But it also means every day at 10:10, right?

It's the same thing. This cron component is designed to make you read the most easy format.

Every day at 10:10 = Every week on every day of the week at 10:10 = Every month on every day of the month n every day of the week at 10:10, ect...

Let me know if I understood what you meant?

@Gunjansokal07
Copy link
Author

Hi @xrutayisire, thank you for your quick response.

Yes, you've understood the issue correctly. However, when we set the defaultPeriod to "Weekly" and then set the cron value as "10 10 * * *" [using default value for cron], it should persist the period as "Weekly." But it appears to be changing the period in the dropdown to "Daily."

Could you please look into this? Your assistance is greatly appreciated.

@xrutayisire
Copy link
Owner

Hi,

It's true that the default value for period should be persisted.
Also, the same problem happens when we set to only allow "Weekly" period, daily will be selected when it should keep the only allowed one.

It's necessary to rework the period management and the fallback system.
I currently don't have time to fix that, if you want to open a PR I would review it.

If not, I will do it, but I'm not really sure when. Could be something in November.

Thank you for the bug report 🙏

@xrutayisire xrutayisire added bug Something isn't working PR welcome You can open a PR for this issue labels Oct 29, 2023
@Gunjansokal07
Copy link
Author

Thanks @xrutayisire for response. I am also little bit busy with work. But I will try to look into this. Meanwhile if you get the time then kindly fix it.

Thanks in advance.

@Gunjansokal07
Copy link
Author

Hi,

It's true that the default value for period should be persisted. Also, the same problem happens when we set to only allow "Weekly" period, daily will be selected when it should keep the only allowed one.

It's necessary to rework the period management and the fallback system. I currently don't have time to fix that, if you want to open a PR I would review it.

If not, I will do it, but I'm not really sure when. Could be something in November.

Thank you for the bug report 🙏

Hi @xrutayisire ,
Is there any update on this?

@xrutayisire
Copy link
Owner

Hi,

No sorry I really have no time since quite some time now. I'm not sure when I could take care of that in a near future. 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR welcome You can open a PR for this issue
Projects
None yet
Development

No branches or pull requests

2 participants