Skip to content

Implemented Calendar date picker - #114

Open
zapataa0 wants to merge 15 commits into
developmentfrom
CalendarDatePicker
Open

zapataa0 wants to merge 15 commits into
developmentfrom
CalendarDatePicker

Conversation

@zapataa0

Copy link
Copy Markdown
Collaborator

Related Issue

Fixes #88

Description

Updated the deadline creation form to use a native HTML5 date picker (type="date"), allowing users to select dates visually via a calendar pop-up while allowing users to continue using direct keyboard input. Also cleaned up broken HTML code in the template.

Changes Made

  • Updated input type to type="date" for visual calendar selection.
  • Removed duplicate <input> tag and redundant id="datepicker" attribute.
  • Fixed missing closing </div> tag to restore proper Bootstrap form grid layout.
  • Removed unnecessary placeholder="mm/dd/yyyy" attribute.
  • Updated backend date parsing in deadlineManagement.py to handle ISO format (%Y-%m-%d).

How to Test

  1. Navigate to the Create a Deadline Section.
  2. Click the calendar icon to the right of the date input field to trigger the browser's calendar picker.
  3. Select a date visually, or type a date directly into the field.
  4. Verify the form submits properly and layout aligns cleanly across screen sizes.


<div class="form-group col-md-4 col-sm-4" style="padding-right: 20px;">
<input type="text" id="datepicker" class="form-control" name="deadlineDate" required>
<input type="date" id="deadlineDate" class="form-control" name="deadlineDate" required>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

So when you switched from datepicker as an id to deadlineDate it didn't have any impact because deadlineDate id is not use in any other place at all. form the deadlineDate name it does as it is the value that the backend grab when they called data['deadlineData']. So you don't need to change the id at all. In fact, the id can be removed as the id is not use else where at all on the front-end.

<div class="form-group col-md-4 col-sm-4" style="padding-right: 20px;">
<input type="text" id="datepicker" class="form-control" name="deadlineDate" required>
<input type="date" id="deadlineDate" class="form-control" name="deadlineDate" required>
</div>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Moreover, because you switch from the type as text to date we no longer need the .datepicker() jquery UI. I tried cross browser capability test. They work with both safari, mozilla and chrome. So you can remove the .datepicker() use for the older datepicker id.

Comment thread create_db.py
'''
import os, sys
import importlib
import pymysql

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

those are files that shouldn not be push as they are not part of your issue description: setup.sh, readme.md, secret_config.md, config.yaml and create_db.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Calendar Date Picker for Deadline Creation

2 participants