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.

isInvalidDate still allow for selecting a range on either side of the invalid date.

See original GitHub issue

This is perhaps a tricky issue as, perhaps you want to allow people to do that (ie. blocking out weekends, but allowing people to still select that range).

In which case - the user could apply their own ‘unselect the range’ function with datesUpdated - but for the inline picker this means you need to be able to set the set the start date and end date as inputs.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
marshall86commented, Sep 10, 2019

@dwjohnston if there are InvalidDates from isInvalidDate function, range (with a date invalid) becomes the first range until the first invalid date.

For our example (say you have January 20 and 21 disabled, you can still select the range 18th Jan to 23rd Jan .), the range become: 18th Jan to 19 Jan (since 20 is the first disabled)

Does this statement solve this issue?

About this issue, if i select a range of dates and there are some disabled in said range, the result should be the full range in any case with the disabled dates showed in the calendar.

Can you fix it please?

1reaction
dwjohnstoncommented, Oct 19, 2018

I think there should be two options.

The first is that it returns a list of dates within the range, excluding the invalid dates.

The second is that it’s an invalid selection.

On Fri, 19 Oct 2018, 6:00 PM Fetrarijaona R., notifications@github.com wrote:

Thanks, What would be the right behaviour when this happened in your opinion? A result with an array of all available date? or the first available date? or just not return a result?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fetrarij/ngx-daterangepicker-material/issues/46#issuecomment-431264889, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWmMbTy4nqJP4ZM05ylaTj48vPzKiIgks5umXilgaJpZM4WooB2 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Date range picker - invalid date - Stack Overflow
I use this code and it works perfectly. Date 11/12/2015 is disabled and users can't select it. isInvalidDate: function(date) ...
Read more >
4.4. Validate Traditional Date Formats - O'Reilly
You want to use a simple regex that simply checks whether the input looks like a date, without trying to weed out things...
Read more >
useRangeCalendar – React Aria - React Spectrum Libraries
Touch friendly – Date ranges can be selected by dragging over dates in the ... isInvalid, boolean, Whether the cell is part of...
Read more >
Date Range Picker for Bootstrap
EVENTS is an array with the dates that should go inside the calendar. action.isInvalidDate = function (date) { let invalid = false; EVENTS.forEach((event)...
Read more >
RangeError: invalid date - JavaScript - MDN Web Docs
The JavaScript exception "invalid date" occurs when a string leading to an invalid date has been provided to Date or Date.parse().
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