-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Date Picker improvement #265
base: main
Are you sure you want to change the base?
Date Picker improvement #265
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Thank you for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better
index.html
Outdated
<script> | ||
const today = new Date(); | ||
const yesterday = new Date(today.setDate(today.getDate())).toISOString().split('T')[0]; | ||
document.getElementById('pickupDate').setAttribute('min', yesterday); | ||
</script> | ||
<div class="form-group"> | ||
<label for="dropoffDate">Drop-off Date</label> | ||
<input type="date" id="dropoffDate"> | ||
</div> | ||
<script> | ||
const minDateInput = document.getElementById('pickupDate'); | ||
const maxDateInput = document.getElementById('dropoffDate'); | ||
minDateInput.addEventListener('change', function() { | ||
const selectedMinDate = new Date(minDateInput.value); | ||
// Set max date as selected min date | ||
const maxDate = new Date(selectedMinDate.setDate(selectedMinDate.getDate())).toISOString().split('T')[0]; | ||
maxDateInput.setAttribute('min', maxDate); | ||
}); | ||
</script> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akbatra567 kindly review the updated index.html file and let know if any other changes are to be made |
could you take a pull there are some merge conflicts in index.html file ? @shalini-bhandari |
i want to work on this can you assign this to me |
@RITIK-CHAUDHRY, this is a PR and not an issue. |
🚀 Pull Request
Description
Before : Past Date could be selected
After changes : Minimum date for Pickup Date is set to today and for dropoff minimum is set to what the user selected as pickup date
Fixes #139
Type of Change
Checklist:
Screenshot of final output/video
Screen.Recording.2024-10-07.at.10.20.10.mov