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.

Question: how to disable future days/months

See original GitHub issue

Hi y’all,

I’m working on an app that needs to display some historical data in a graph. I would like to the restrict the user to only be able to choose past days/months. How is this possible here? I see the isOutsideRange but I’m not sure if that’s the one to use and how to go on about it.

Best regards Dan

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

4reactions
rootedsoftwarecommented, Apr 4, 2018

To get this to work I had to do

isOutsideRange={day => isInclusivelyAfterDay(day, moment().add(1, 'days'))}
4reactions
ConAntonakoscommented, Jun 16, 2017

After attempting this, I believe day and today need to be switched?

isOutsideRange={day => isInclusivelyAfterDay(day, today)}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Question: how to disable future days/months #390 - GitHub
Hi @dgsunesen! You can accomplish this by doing: import { isInclusivelyAfterDay } from 'react-dates'; const today = moment(); // alternatively ...
Read more >
How to disable future dates in datepicker? - Stack Overflow
You can do this: Datepicker has an option maxDate. $(document).ready(function () { var today = new Date(); $('.datepicker').datepicker({ ...
Read more >
How to disable future dates in JavaScript Datepicker?
How to disable future dates in JavaScript Datepicker? - In order to disable future dates, you need to use maxDate and set the...
Read more >
Need to disable future date in Date Time Calendar Control
Open the properties of the particular date property.Go to presentation tab,go to the display range and uncheck the checkbox for Next and enter...
Read more >
Solved: Disable the future dates in datepicker
However you can achieve this using formulas. Check workarounds given in below posts, it should help you: DatePicker - disable future days. Restrict...
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