53
Views
4
Comments
iOS Limitation,i can't  set "Max" and "Min" properties in date input widget
Question

Because of  IOS Limitation,i can't  set "Max" and "Min" properties in date input widget,But i need to implement that functionality in IOS..can you kindly give me the solution for this issue.

In that below image,i need to disable current date,How can i achieve that in IOS,kindly guide me.


Image (1).png
Edited by a moderator on 05 May 2025 at 17:48
2025-03-12 07-08-15
Nilesh Trivedi

Hi @Srigovindh-EONE,

Use JavaScript Validation on Change

<script>
  const input = document.getElementById("myDate");
  const minDate = new Date("2024-01-01");
  const maxDate = new Date("2025-12-31");

  input.addEventListener("change", function () {
    const selectedDate = new Date(this.value);
    if (selectedDate < minDate || selectedDate > maxDate) {
      alert("Date is out of allowed range!");
      this.value = ""; // or reset to min/max
    }
  });
</script> 

2024-05-14 06-52-28
Srigovindh-EONE

I tried it, but it doesn't work on an actual iOS device. 

2025-04-30 18-21-22
Senthil Nathan A

Hi @Srigovindh-EONE 

Use Forge Plugin: Advanced DatePicker (Cordova Plugin)

This plugin gives you control to disable specific dates, including today - directly inside the calendar UI.

Benefits:

  • Works on both iOS and Android

  • You can disable individual dates (like today)

  • Full customization (theme, min/max, date range, etc.)

Thanks,

Senthil


2016-04-22 00-29-45
Nuno Reis
 
MVP

Srigovindh, please  write a decent title for your questions. Otherwise the people who can help you faster may not even open the topic for not knowing what it is about.


With a good title, it is easy to find the question and answers, if the same problem appears.

Example:

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.