Files
calctext/_bmad-output/implementation-artifacts/4-6-relative-time-expressions.md
2026-03-16 19:54:53 -04:00

51 lines
1.6 KiB
Markdown

---
epic: 4
story: 4.6
title: "Relative Time Expressions"
status: draft
---
## Epic 4 — Date, Time & Time Zones
**Goal:** Full date/time math, business day calculations, and timezone awareness.
### Story 4.6: Relative Time Expressions
As a CalcPad user,
I want to write relative time expressions like "2 hours ago" or "next Wednesday",
So that I can reference dates and times naturally without specifying absolute values.
**Acceptance Criteria:**
**Given** the expression `2 hours ago`
**When** the engine evaluates it
**Then** it returns a `DateTime` representing the current time minus 2 hours
**Given** the expression `next Wednesday`
**When** the engine evaluates it
**Then** it returns the date of the next upcoming Wednesday
**And** if today is Wednesday, it returns the following Wednesday (not today)
**Given** the expression `last Friday at 3pm`
**When** the engine evaluates it
**Then** it returns the date of the most recent past Friday at 3:00 PM in the user's local timezone
**Given** the expression `3 days ago`
**When** the engine evaluates it
**Then** it returns the date that was 3 days before today
**Given** the expression `in 2 weeks`
**When** the engine evaluates it
**Then** it returns the date 14 days from today
**Given** the expression `yesterday`
**When** the engine evaluates it
**Then** it returns the date of the previous day
**Given** the expression `tomorrow at noon`
**When** the engine evaluates it
**Then** it returns tomorrow's date at 12:00 PM in the user's local timezone
**Given** the expression `last Monday` when evaluated on a Monday
**When** the engine evaluates it
**Then** it returns the previous Monday (7 days ago), not today