Skip to content

Set defaults for date/time picker and timezone#1996

Open
asarj wants to merge 3 commits into
jupyter:mainfrom
asarj:add-defaults-for-due-date-time-picker
Open

Set defaults for date/time picker and timezone#1996
asarj wants to merge 3 commits into
jupyter:mainfrom
asarj:add-defaults-for-due-date-time-picker

Conversation

@asarj
Copy link
Copy Markdown

@asarj asarj commented Apr 20, 2026

Summary

Fixes #1884

The due date picker in the formgrader's "Manage Assignments" page had two UX issues: the time component defaulted to the current time instead of midnight, and the timezone field was empty in the create modal. Faculty would unintentionally save inconsistent due times like 14:37 when they only changed the date.

Changes

  • Pass the server's configured timezone offset to the template and pre-fill it in the create modal
  • On first click into an empty date field, default to today at 00:00 (using a one-time focus handler so users who skip the field get no due date)
  • Existing due dates in the edit modal are preserved unchanged

Tests

  • Backend: test_get_assignment_custom_timezone: verifies non-UTC timezone propagation
  • E2E: Due date defaults: validates midnight default on focus, timezone pre-fill, and no-date regression

Manual verification

  1. "Add new assignment..." --> timezone pre-filled, date empty
  2. Click into date field --> defaults to today at 00:00
  3. Save without touching date --> due date is "None"
  4. Edit existing assignment --> original date/time preserved

Per the pull request guidelines:

  • Added regression tests
  • No documentation changes needed

@asarj asarj changed the title [WIP ]Set defaults for date/time picker and timezone [WIP] Set defaults for date/time picker and timezone Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Binder 👈 Launch a Binder on branch asarj/nbgrader/add-defaults-for-due-date-time-picker

@asarj
Copy link
Copy Markdown
Author

asarj commented Apr 20, 2026

Manual Steps to test after launching a JupyterLab instance

  1. Press Ctrl/Cmd + Shift + C, type "formgrader", click "Formgrader"
  2. You should be redirected to the "Manage Assignments" page
  3. Verify there is a "hw1" entry already populated

Test the create modal:

  1. Click "Add new assignment..." at the bottom
  2. Check: timezone field should show +0000 (not empty)
  3. Check: date field should be empty
  4. Click into the date field
  5. Check: it should fill with today's date at 00:00
  6. Click Cancel

Test saving without a date:

  1. Click "Add new assignment..." again
  2. Type test1 in the Name field
  3. Do NOT touch the date field
  4. Click Save
  5. Check: the assignment should show due date as "None"

Test saving with a date:

  1. Click "Add new assignment..." again
  2. Type test2 in the Name field
  3. Click into the date field (it fills with today at 00:00)
  4. Change the date to tomorrow, leave time at 00:00
  5. Click Save
  6. Check: the assignment should show tomorrow's date with time 00:00:00

Test the edit modal:

  1. Click the pencil icon next to test2
  2. Check: the existing date/time should be preserved (not overwritten)
  3. Click Cancel
  4. Click the pencil icon next to test1 (no due date)
  5. Check: date field is empty
  6. Click into the date field
  7. Check: it fills with today at 00:00

@asarj asarj marked this pull request as ready for review April 20, 2026 20:14
@asarj asarj changed the title [WIP] Set defaults for date/time picker and timezone Set defaults for date/time picker and timezone Apr 20, 2026
@asarj
Copy link
Copy Markdown
Author

asarj commented May 4, 2026

hi @brichet can you please trigger the CI checks again?

@asarj
Copy link
Copy Markdown
Author

asarj commented May 4, 2026

Seems the lone failing test was due to 20 min timeout, is it permissible to increase the timeout to something longer (like 30 mins) or somehow increase the number of workers that execute CI tests?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bad defaults for due date date/time picker

2 participants