question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Single selection for when Month or Year is active.

See original GitHub issue

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 or Every Year is active. Currently when month or year is selected the schedule contains an AND <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 on 4 at 3:30’ ‘Every year in APR on 4 at 3:30

Describe alternatives you’ve considered I have tried to hide the dropdown using CSS through the className prop & overriding the schedule value in the setValue 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 selected

Additional context image

feature-request

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
xrutayisirecommented, Jun 27, 2022

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

2reactions
xrutayisirecommented, Jun 26, 2022

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:

Screenshot 2022-06-26 at 01 35 38 Screenshot 2022-06-26 at 01 36 07
Read more comments on GitHub >

github_iconTop Results From Across the Web

Show last 6 months based on user single slicer selection
... groups to show the behavior of any measure in the last 6 months (or any other number of months ), starting from...
Read more >
Enable one selection based on other - Qlik Community - 593639
If you will be selecting only one year and one month, having two list boxes, one for year and the second one for...
Read more >
Extracting Month and year based on current selection
I want to create comparison chart like it should pull most recent month of year and compare it same month of previous year....
Read more >
jQuery UI DatePicker to show month year only - Stack Overflow
Monthpicker instantiation The value retrieved from this monthpicker, is always the FIRST day of the selected month. Starts at the current month, and...
Read more >
Show previous 6 months of data from single slicer selection
The selection in the slicer is on a single month. Therefore, all visuals show the data for that date only. All except for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found