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.

Set current date as max date for Date question

See original GitHub issue

Are you requesting a feature, reporting a bug or asking a question?

question

What is the current behavior?

Date control works fine

What is the expected behavior?

How do I set the current date as max date? In order to not allow the users to select future dates?

How would you reproduce the current behavior (if this is a bug)?

Provide the test code and the tested page URL (if applicable)

Tested page URL:

Test code

your_code_here

Specify your

  • browser: chrome
  • browser version:
  • surveyjs platform (angular or react or jquery or knockout or vue): angular 5
  • surveyjs version: 1.0.38

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
andrewtelnovcommented, Sep 8, 2020

The current solution is to use the min property as: min: "=today()", from v1.8.1+

Thank you, Andrew

0reactions
ashygkcommented, Nov 27, 2018

@andrewtelnov We used to have jquery datepicker previously, but we reverted back to the default input as we were having lot many issues with that custom widget. Is there any possible workaround to stop the user from manually entering future dates using the default input?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set date input field's max date to today - Stack Overflow
Umm, I am attempting this, and it won't set the maximum date.. It still lets me select dates outside of the maximum, e.g....
Read more >
Set current date as max date for Date question #1337 - GitHub
I don't want the validators to validate the date. I want the future dates to be disabled/non-selectable.
Read more >
Creating max date available as default filter - Question & Answer
Currently I am using Top 1 date basis max date available to default it to latest date available in the dataset. My Stakeholder...
Read more >
<input type="date"> - HTML: HyperText Markup Language
If both the max and min attributes are set, this value must be a date string later than or equal to the one...
Read more >
Max date but less than or equal to current date
Hi All,. I am trying to create a calculated field on a date field, where I want to pick the max available date...
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