Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shalini-bhandari
Copy link

🚀 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Screenshot of final output/video

Screen.Recording.2024-10-07.at.10.20.10.mov

Copy link

@github-actions github-actions bot left a 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
Comment on lines 101 to 120
<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>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not add new script tags, add this script in the tag at the at line 612.

Also, look at why the css is showing that there are error even after the first load:

Current Version:
Screenshot 2024-10-12 at 12 43 21 AM

Changes in this PR:
Screenshot 2024-10-12 at 12 43 26 AM

@akbatra567 akbatra567 added the status: requested-changes PR / Issues is reviewed and asked for some changes label Oct 11, 2024
@shalini-bhandari
Copy link
Author

@akbatra567 kindly review the updated index.html file and let know if any other changes are to be made

@akbatra567
Copy link
Collaborator

could you take a pull there are some merge conflicts in index.html file ? @shalini-bhandari

@akbatra567 akbatra567 added status: merge-conflicts PR has some merge conflicts and removed status: requested-changes PR / Issues is reviewed and asked for some changes labels Oct 14, 2024
@RITIK-CHAUDHRY
Copy link

RITIK-CHAUDHRY commented Oct 16, 2024

i want to work on this can you assign this to me

@akbatra567
Copy link
Collaborator

i want to work on this can you assign this to me

@RITIK-CHAUDHRY, this is a PR and not an issue.
Could you find a new issue you can work on ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc-ext GSSoC'24-Extd level1 status: merge-conflicts PR has some merge conflicts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Date Picker improvement
3 participants