-
Notifications
You must be signed in to change notification settings - Fork 106
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
Single selection for when Month or Year is active. #28
Comments
Hello, First thank for using this package and for this well described issue! I just a release the new v2.0.0 containing a new feature for you 🥳 2 new props: allowedDropdowns and allowedPeriods. Now you should be able to hide the week-days dropdown as in your example: |
Hum, I don’t really understand the issue, how did you put the 0 for Sunday? The goal of the feature is to not let the user select the week day, so user should not be able to select Sunday at all. If there is another way to set 0 I think it’s outside of the component scope. For your second point, the component don’t handle the logic between the two props. If you decide to remove the week days dropdown it will not be displayed. Even if week is selected. The component don’t know the logic you want to apply. Maybe it could be a new feature that allow you to know which period is selected and so dev can apply some logic for the allowedDropdowns props depending on the period? |
Oh ! I understand why you have this 0 for Sunday, it’s because you set « @ weekly » for default value. Because of this, weekly set 0 for Sunday and it’s normal it’s the proper way to handle the shortcut weekly. (https://gist.github.com/jpluimers/6510369) I will think a bit more about this new feature but it could be on the setValue prop, a new param « selectedPeriod » after the first param for the new value. What do you think about this? |
An extra parameter on the As for the default value being weekly - I don't think there's a way for my app to use something else. The schedules we have stored are weekly with a day of the week set such as: Having an extra parameter on the Thank you for the fast responses and quick turnaround on v2.0.0!! |
Thanks! 😃 I just added a new param for the setValue function named "extra". I preferred an object if one day I need to add another param in it. In extra you will find "selectedPeriod". Before publishing a new version, can you tell me if it's good for you like this? Demo: https://xrutayisire.github.io/react-js-cron/?path=/docs/reactjs-cron--track-selected-period |
Yes this works! Thanks again Xavier!! |
New release v2.1.0 with the new feature to know the selected period 🥳 |
Is your feature request related to a problem? Please describe.
It would be great to have the ability to restrict the cron schedule to only happen once when
Every Month
orEvery Year
is active. Currently when month or year is selected the schedule contains anAND <Day of the Week>
. See screenshot of example page below.Describe the solution you'd like
Ideally if its possible a new config or using the same
mode='single'
to hide that dropdown when month or year is selected.My goal is to be able to read the following:
'Every
month
on4
at3
:30
''Every
year
inAPR
on4
at3
:30
'Describe alternatives you've considered
I have tried to hide the dropdown using CSS through the
className
prop & overriding the schedule value in thesetValue
callback. I ran into issues with that route because when you flip from week to month or week to year the schedule is not changed. The value remains the same making it hard to know wether month or year is currently selectedAdditional context
The text was updated successfully, but these errors were encountered: