Skip to content

Take end times for every parking length, and give time fields the same text (#200, 3/3) - #218

Open
NinjaLikesCheez wants to merge 2 commits into
time-input-previewfrom
time-input-everywhere
Open

NinjaLikesCheez wants to merge 2 commits into
time-input-previewfrom
time-input-everywhere

Conversation

@NinjaLikesCheez

@NinjaLikesCheez NinjaLikesCheez commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Third and last PR of the stack for #200 (spec: #200 (comment)). Merge #215, then #216, first.

What changes

Every parking length takes an end time too. /park for:, Another length…, staying longer (the extend action) and Give it to someone… in /admin → Parking now read lengths with readParkingLength (services/parking-time.ts), which uses the shared core/how-long.ts:

  • a duration, as before: 30m, 2h30, for 2 hours
  • an end: until 17:00, till 5pm, to 17:00, or just 17:00
  • rest of day, still parking's own

When extending, a length counts from the current end, as before, and an end is when it should end. The reply says which: ✅ Extended by 1h. or ✅ Extended until 12:30. The existing limits are unchanged (the reset, when the spot closes, the "can only be extended by …" message). An end that rolls past the reset (till 9am after 9:00 is tomorrow's) gets the usual "Parking ends at 23:59 every day, so that's too long."

/park for:'s preview uses the same reader, so until 17:00 shows until 17:00 → 7h, until 17:00.

One refusal everywhere. These inputs now use howLongRefusal instead of their own "I couldn't understand how long" messages:

How long: I couldn't understand it. Type how long, or until when in Europe/Amsterdam, for example 30m, 2h30, until 17:00 or rest of day.

Consistent form text. placeholderOf (core/time-help.ts) writes examples as a placeholder (19:00 · fri 8pm · 14th oct · tomorrow noon · in 2 hours). Every form field that takes a time uses it and says which time zone:

Form Field Placeholder
/schedule details When 19:00 · fri 8pm · 14th oct · tomorrow noon · in 2 hours
/schedule Reminders Remind every day at 18:00 · 6pm
/schedule Results Totals so far at 17:00 · 5pm
/park How long (Another length…) 30m · 2h30 · until 17:00 · rest of day
/admin → Parking From / Until now · in 1 hour · 8:00 · tomorrow 8 / 17:00 · 5pm · in 2 hours (nothing past the reset)
/admin → Parking Reset / How long (Give it to someone…) 23:59 · midnight / 2h · until 17:00 · rest of day

/park for:'s option description mentions until 17:00. Run just register dev / just register prod after deploying so Discord shows the new description.

Not changed

  • How long a poll stays open is a fixed choice (Discord's own poll durations), not typed, so it has no parser to switch.
  • The durations offered in parking's settings stay durations (parseDuration): they're buttons ("Park for 2h"), not ends.

Docs

docs/commands.md (/park, Give it to someone…, the /schedule form mock-up) and docs/architecture.md (parking Time). The changelog has an Added entry for end times and a Changed entry for the placeholders.

Review

No rule 14 paths are touched. core/time-help.ts gains placeholderOf. Parking's logic only changes where a typed length is read.

Testing

  • just check passes.
  • New tests: /park for: until 11:30, till 9am past the reset, a vague word, until 12:30 when extending, Give it to someone… until 16:00, readParkingLength, and the end-time preview.
  • Updated tests: the refusal text in /park and /admin → Parking.

Closes #200.

🤖 Generated with Claude Code

…e text (#200)

Third of the stack for #200.

- /park for:, Another length…, staying longer and Give it to someone… read
  lengths with readParkingLength (core/how-long.ts plus "rest of day"), so
  "until 17:00" works as well as "2h30". Refusals use howLongRefusal.
- Every form field that takes a time shows examples the same way
  (placeholderOf in core/time-help.ts) and names the time zone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread src/features/admin/parking-panel.ts Resolved
midnight is 00:00 at the end of today, after the 23:59 reset, so the example
would be refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Make typing dates and times easier (free-form "when" parsing)

1 participant