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.

[DateRangePicker] Allow same date selection

See original GitHub issue
               <DateRangePicker
                  startText="Created From"
                  endText="Created To"
                  allowSameDateSelection={true}
                  value={[
                    searchCriteria.beginDate,
                    searchCriteria.endDate,
                  ]}
                  onChange={}
                  renderInput={(startProps, endProps) => (
                    <React.Fragment>
                      <TextField
                        {...produce(startProps, (draft) => {
                          draft.helperText = '';
                        })}
                      />
                      <DateRangeDelimiter> to </DateRangeDelimiter>
                      <TextField
                        {...produce(endProps, (draft) => {
                          draft.helperText = '';
                        })}
                      />
                    </React.Fragment>
                  )}
                />

image

i think the issue is in the validateDateRange function. This function not use the allowSameDateSelection to pass the validate of utils.isBefore(range[0], range[1])

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
bennoparikhcommented, Sep 16, 2020

I have this problem also. I would appreciate if it could be fixed as fast as possible. Thanks!

1reaction
oliviertassinaricommented, Nov 21, 2020

@hmaddisb I think that we can try a pull request 😃, we would need to add a test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[DateRangePicker] Allow same date selection #23603 - GitHub
As far as I know, there are no valid use cases for it, no matter a date picker, time picker, date range picker,...
Read more >
daterange picker both date same - Stack Overflow
You are using an older version of daterangepicker so update your daterangepicker js and css which can solve your issue.
Read more >
Date Range Picker — JavaScript Date & Time Picker Library
singleDatePicker : (true/false) Show only a single calendar to choose one date, instead of a range picker with two calendars. The start and...
Read more >
DateRangePicker API - Material-UI Pickers
Name Type Default value * RangeInput acceptRegex RegExp /\dap/gi allowKeyboardControl boolean currentWrapper !== 'static'
Read more >
Range Restriction in JavaScript DateRangePicker control
You can restrict the minimum and maximum date that can be allowed as start and end date in a range selection with the...
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