OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

date input issue when adding max and min properties

  • Thread starter Thread starter Chetan Sonar
  • Start date Start date
C

Chetan Sonar

Guest
Code:
<input
  type="date"
  id="chooseDate"
  name="chooseDate"
  value={selectedDate}
  onChange={(e) => handleScheduleDate(e.target.value, assessorId, true)}
  disabled={assessorId ? false : true}
  class="form-control font12"
  min={moment(new Date()).format("YYYY-MM-DD")}
  max={moment(new Date(disableMaxDays)).format("YYYY-MM-DD")}
  placeholder="YYYY-MM-DD"
/>

Initially, the date format issue displayed as "dd-06-2024". After commenting out the min and max, it displayed as "dd-mm-yyyy.

Thank you in advance

<pre class="lang-html prettyprint-override"><code><input
type="date"
id="chooseDate"
name="chooseDate"
value={selectedDate}
onChange={(e) => handleScheduleDate(e.target.value, assessorId, true)}
disabled={assessorId ? false : true}
class="form-control font12"
min={moment(new Date()).format("YYYY-MM-DD")}
max={moment(new Date(disableMaxDays)).format("YYYY-MM-DD")}
placeholder="YYYY-MM-DD"
/>
</code></pre>
<p>Initially, the date format issue displayed as "dd-06-2024". After commenting out the min and max, it displayed as "dd-mm-yyyy.</p>
<p>Thank you in advance</p>
 
Top