Default event form dates to today with end matching start#304
Merged
Conversation
Pre-fill the public submission form's Start Date to today's date (giving the current year) and initialize End Date to match. When the Start Date changes, the End Date follows it as long as the two are still in sync, so a deliberately different (multi-day) end date is preserved. The post-submit reset restores the same today-based defaults. 🐦⬛ Generated with Claude Code, orchestrated by Crow Co-Authored-By: Claude <noreply@anthropic.com> Crow-Session: B1805E25-C75C-4A71-8A30-83AB0F302A81 Claude-Session: https://claude.ai/code/session_01PnvbpjMGn3C5MxoN7iPUcY
c83ca34 to
5f173cb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #301
What & why
The public event submission form (
[mayo_event_form]) started with blank Start Date and End Date fields. Issue #301 asked to default the End Date to the Start Date and to default the start year to the current year.Changes (
assets/js/src/components/public/EventForm.js)<input type="date">can't default only the year). Uses a local-timegetTodayLocalDate()helper — nottoISOString()— to avoid a UTC off-by-one.No PHP changed.
readme.txtchangelog updated under the unreleased= 1.9.2 =section (no version bump). Thepackage-lock.jsondiff is just a stale1.9.1 → 1.9.2version sync withpackage.json.Testing
npm run buildcompiles cleanly.