-2

We are using <input type="date"/>.

How can we make holiday dates disabled so that users cannot select the date?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Sonalg
  • 1
  • 2
  • Does this answer your question? [Disable certain dates from html5 datepicker](https://stackoverflow.com/questions/17182544/disable-certain-dates-from-html5-datepicker) – Miss Skooter Mar 09 '23 at 16:52
  • The link has explained about disabling the rang of dates. MIN and MAX attribute. I want to disabled specific dates like Christmas , Thankgiving , Easter date – Sonalg Mar 10 '23 at 05:50
  • yes, but the link explains that it is not possible, unless there has been changes since it was posted (9 years ago) but that does not seem to be the case. – Miss Skooter Mar 10 '23 at 07:20
  • Yes, you are correct; the post was old, which is why I brought it up once more to see if anyone had the answer. – Sonalg Mar 10 '23 at 08:02

1 Answers1

0

To accomplish this, I built a function that takes today's date, checks it against an array of holiday dates and increments the date until it doesn't match an array entry. I store the holidays in a separate file so that it can be updated annually without impacted the rest of the codebase.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 21 '23 at 07:16