Skip to content

Commit

Permalink
Merge pull request #1017 from akash70629/calender
Browse files Browse the repository at this point in the history
🛠️FIX : Calendar Date Validation to Restrict Past Dates
  • Loading branch information
ankit071105 authored Nov 6, 2024
2 parents 5cd7d59 + d78e742 commit c92dcef
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions sell.html
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,14 @@ <h1>Sell Ticket</h1>

<div class="form-cont">
<label for="date">Date:</label>
<input type="date" id="date" required>
<input type="date" id="date" required min="">
</div>

<script>
// calender date validation logic
const today = new Date().toISOString().split('T')[0];
document.getElementById('date').setAttribute('min', today);
</script>

<div class="form-cont">
<label for="coachType">Coach Type:</label>
Expand Down Expand Up @@ -984,7 +990,13 @@ <h1>Sell Bus Ticket</h1>
<input type="time" id="departureTime" name="departureTime" required>

<label for="date">Date:</label>
<input type="date" id="date" name="date" required>
<input type="date" id="date2" name="date" required min="">

<script>
// calender date validation logic
const today2 = new Date().toISOString().split('T')[0];
document.getElementById('date2').setAttribute('min', today2);
</script>

<label for="seatNo">Seat Number:</label>
<input type="text" id="seatNo" name="seatNo" required>
Expand Down

0 comments on commit c92dcef

Please sign in to comment.