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.

Can I select only past dates?

See original GitHub issue

By using isOutsideRange={() => false} I enabled all past dates. Now I need something like isInsideRange={() => true} to disable all future dates. Does it exist some built in method to disable future dates? If not, can somebody advise, how can I use isDayBlocked method to block all future dates? Thanks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

65reactions
Valentin1918commented, Dec 9, 2016

isOutsideRange={day => !isInclusivelyBeforeDay(day, moment())}

27reactions
mrmuhammadalicommented, Sep 14, 2017

I tried this: isOutsideRange={(day) => day.isAfter(moment()) || day.isBefore(moment().subtract(30, 'days'))} and it is now enabling dates of last 30 days only. Thanks 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Datepicker picks future dates only and disable past ...
To make any past dates unselectable, you first have to find the instantiation of the datepicker, and set the minDate setting to zero....
Read more >
Can I select only past dates? · Issue #209 · react ... - GitHub
I tried this: isOutsideRange={(day) => day.isAfter(moment()) || day.isBefore(moment().subtract(30, 'days'))} and it is now enabling dates of ...
Read more >
Solved: Select present and future dates only
Hello, I wanted to ask if there is a way to have someone only be able to select a date that is today...
Read more >
Disable past dates from datepicker in powerapps
In my App, where I datepicker field coming from sharepoint list. I want disable the past dates , user should only select today...
Read more >
How to restrict past/future date selection in #servicenow
In this video I've explained how to restrict past /future date selection in date type fieldIf you ... Your browser can 't play...
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