Repository navigation
Open
Labels
Type: BugBugs and errorsBugs and errors
Description
Reproduction Steps
- As an administrator, go to LifterLMS → Courses, open a course, and click Launch Course Builder.
- Add a lesson (or use an existing one) and click its Settings link to open the lesson settings panel.
- Under Course Drip Method, set Drip Method to On a specific date, pick a date, and set Time to
02:00 PM. Click Save. - Click into the Time field, then press Tab (or click any other field).
- Click into the Time field again and click another field.
- Click Save, then reload the builder and open the lesson settings again.
Recording on dev (02:00 PM becomes 04:00 PM after Tab, 08:00 PM after clicking away, and 08:00 PM is saved):
Expected Behavior
Leaving the Time field without picking a new time keeps the time that was entered (02:00 PM).
Actual Behavior
The time changes every time focus leaves the field. With the builder on dev it can jump by several hours at once (02:00 PM → 04:00 PM → 08:00 PM), and the changed time is saved as the lesson's drip time. Times at 12 also flip between AM and PM (12:00 PM → 11:00 PM).
The quiz and assignment due time fields in #3446 use the same picker and the same h:i A format, so they are affected too (one hour earlier per Tab on that branch).
Technical Notes
- The builder's date/time fields use the bundled xdsoft datetimepicker 2.5.18 (
assets/vendor/datetimepicker/), added in 3.17.0. It bundles php-date-formatter 1.3.4. - With
validateOnBlur(the picker's default), every blur parses the field's value and writes it back formatted. php-date-formatter 1.3.4 parses a 12-hour hour (h/gwithA/a) ashour + meridiem offset - 1, so02:00 PMparses as 13:00 and is written back as01:00 PM;12:00 PMparses as 23:00 and12:00 AMas 11:00. - Upstream fixed this in kartik-v/php-date-formatter@7e5fa68 ("Fix Added recentrly changelog #12: Correct hour merdian validation", released in 1.3.5):
hour % 12 === 0 ? offset : hour + offset. - On
dev, the builder'sonClose: function() { $input.blur(); }(assets/js/builder/Views/_Editable.js) makes one blur re-trigger the picker's blur handler about 900 times untilRangeError: Maximum call stack size exceeded, and each pass shifts the time again, so the result looks random. Without the recursion (fixed in Fix 12-hour times shifting an hour in builder date pickers #3479), each blur moves the time back exactly one hour. - Date-only (
Y-m-d) and 24-hour (H:i) formats are not affected.
System and Environment Information
System Report
N/A — reproduced on a wp-env site running LifterLMS `dev` (93fc28241) with SCRIPT_DEBUG on and off.
This issue has be recreated:
- Locally
- On a staging site
- On a production website
- With only LifterLMS and a default theme
Browser, Device, and Operating System Information
- Chromium 148 (headless), Linux
- Browser independent: the bug is in the bundled JavaScript date parser.
Metadata
Metadata
Assignees
Labels
Type: BugBugs and errorsBugs and errors
Type
Projects
- StatusShow more project fieldsIn Progress

Activity
Only blur a focused input when a builder date picker closes
Move the builder date picker onClose fix to #3479
Fix 12-hour times shifting an hour in builder date pickers (#3479)