Skip to content

Replace bootstrap-datetimepicker#2608

Open
HannesClausnitzer wants to merge 11 commits intoe-valuation:mainfrom
HannesClausnitzer:datetimepicker
Open

Replace bootstrap-datetimepicker#2608
HannesClausnitzer wants to merge 11 commits intoe-valuation:mainfrom
HannesClausnitzer:datetimepicker

Conversation

@HannesClausnitzer
Copy link
Copy Markdown
Collaborator

fixes #2546

Copilot AI review requested due to automatic review settings January 12, 2026 20:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request replaces the bootstrap-datetimepicker JavaScript library with native HTML5 date and datetime-local input types. The change modernizes the date/time input handling by using browser-native controls instead of a third-party library, simplifying the codebase and reducing dependencies.

Changes:

  • Replaced bootstrap-datetimepicker widgets with HTML5 native date/datetime inputs across all forms
  • Removed bootstrap_datetimepicker.html template includes from multiple templates
  • Extracted message rendering into a reusable messages.html template
  • Updated plain_page templates to include message rendering explicitly

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
evap/staff/templates/staff_semester_import.html Removed bootstrap_datetimepicker include and additional JavaScript block
evap/staff/templates/staff_evaluation_form.html Added messages template include for plain_page display
evap/staff/templates/staff_course_copyform.html Removed bootstrap_datetimepicker include
evap/staff/forms.py Updated ImportForm, CourseCopyForm, and EvaluationForm with HTML5 date/datetime widgets
evap/rewards/templates/rewards_reward_point_redemption_event_form.html Removed bootstrap_datetimepicker include
evap/rewards/forms.py Updated RewardPointRedemptionEventForm with HTML5 date widgets
evap/evaluation/templates/messages.html Created reusable messages display template
evap/evaluation/templates/evap_evaluation_edit_js.html Removed bootstrap_datetimepicker include
evap/evaluation/templates/base.html Removed bootstrap_datetimepicker CSS and extracted messages to separate template
evap/contributor/forms.py Updated EvaluationForm widgets (contains bug - incorrect widget type)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread evap/contributor/forms.py Outdated
Comment thread evap/staff/templates/staff_semester_import.html
Copy link
Copy Markdown
Collaborator

@hansegucker hansegucker left a comment

Choose a reason for hiding this comment

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

Also, the file evap/static/js/bootstrap-datetimepicker.min.js still exists.

But apart from that, this looks very good!

Comment thread evap/contributor/forms.py Outdated
Comment thread evap/staff/templates/staff_semester_import.html
@niklasmohrin
Copy link
Copy Markdown
Member

There are also still adjustments in _adjustments.scss for the bootstrap datetimepicker

Copy link
Copy Markdown
Member

@niklasmohrin niklasmohrin left a comment

Choose a reason for hiding this comment

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

Very cool!

We still mention bootstrap-datetimepicker in license.md and the places that are listed in the other comments

Comment thread evap/contributor/forms.py Outdated
Copy link
Copy Markdown
Member

@janno42 janno42 left a comment

Choose a reason for hiding this comment

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

It would be nice to open the picker once the field receives focus.

Also, please investigate if we can force the date and time format to be our default format YYYY-MM-DD HH:mm.

@HannesClausnitzer
Copy link
Copy Markdown
Collaborator Author

So it seems the native datetime-picker in firefox and chromium doesn't meet our needs, as it doesn't support setting the locale and gives a few focus issues (when the date picker is shown, nothing can be typed into the input field).
I have found a different alternative to the bootstrap-datetimepicker that is quite similar but doesn't use jQuery:
https://github.com/Eonasdan/tempus-dominus/
You can try it out here:
https://getdatepicker.com/6/repl.html
What do you think about this? Would it be worth it implementing this?

@richardebeling
Copy link
Copy Markdown
Member

I'll re-mark as draft, if I recall correctly, we decided that a native HTML datetime-local input isn't viable because we had at least one scenario where Firefox would render the time with AM/PM although we didn't want it to (@janno42 right?)

@richardebeling richardebeling marked this pull request as draft February 1, 2026 21:36
@richardebeling richardebeling removed their request for review February 1, 2026 21:36
@niklasmohrin
Copy link
Copy Markdown
Member

niklasmohrin commented Feb 1, 2026

I am very much pro vanilla inputs, if we can get it to work. However, if not, then I guess switching to this tempus dominus thing is still better what we currently have. Both with this or with our current version of datepicker, we don't get support from anyone, but at least dominus lets us get rid of jquery. Based on the Latin name, we should do a quick background check on whether the creator is a nutcase before associating our project with theirs. Update: Richard and I did some digging, nothing worrying turned up

But before that, let's document here when exactly the plain browser things fail us

@HannesClausnitzer HannesClausnitzer marked this pull request as ready for review April 20, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Replace Datetime Picker

6 participants