Logo
Athena Logo

Date Picker — Dayjs Migration Test

Verifies all date-fns → dayjs replacements. Every function that was migrated is exercised below.

Dayjs Replacement Verification

Automated checks for every date-fns function we replaced. All should show PASS.

PASS
format() — MMM DD, YYYYExpected "Mar 17, 2026", got "Mar 17, 2026"
PASS
format() — YYYY-MM-DD (ISO)Expected "2026-03-17", got "2026-03-17"
PASS
format() — D (day without padding)Expected "5", got "5"
PASS
format() — MM/DD/YYYY (input format)Expected "01/09/2026", got "01/09/2026"
PASS
format() — MMMM YYYY (enhanced header)Expected "December 2026", got "December 2026"
PASS
startOfMonth()Expected Mar 1, got Mar 1
PASS
endOfMonth()Expected Mar 31, got Mar 31
PASS
startOfWeek()Mar 17 2026 is Tuesday → week starts Sun Mar 15
PASS
eachDayOfInterval()Mar 1–7 → 7 days (expected 7)
PASS
isSame(day) — same day different time10:30 vs 22:00 on Mar 17 → true
PASS
isSame(day) — different dayMar 17 vs Mar 18 → false
PASS
isSame(month) — same monthMar 1 vs Mar 31 → true
PASS
isSame(month) — different monthMar 31 vs Apr 1 → false
PASS
isToday() equivalentdayjs(now).isSame(dayjs(), 'day') → true
PASS
add(1, month)Jan 15 + 1 month → Feb 15 (expected Feb 15)
PASS
subtract(1, month)Mar 15 − 1 month → Feb 15 (expected Feb 15)
PASS
month() getterMarch → 2 (expected 2, 0-indexed)
PASS
year() getter2026 → 2026
PASS
month(5) setterMar 15 → month 5 → Jun 15 (expected Jun 15)
PASS
year(2028) setter2026 → 2028 → 2028
PASS
parse() — MM/DD/YYYY (strict)"03/17/2026" → valid: true, date: 2026-03-17
PASS
parse() — invalid date (strict)"13/40/2026" → valid: false (expected false)
PASS
diff(year) — age calculationDOB Mar 17, 2000 → age 26 (expected ~26)
PASS
diff(year) — under 18 checkDOB Jun 11, 2009 → age 17, >=18: false
All 24 checks passed

PTDatePicker — Input Parsing

Tests dayjs parse (customParseFormat), isValid, and format for typed date input. Type a date or use the calendar icon.

Calendar Modal Components

Calendar Variant

Features:

  • Traditional calendar grid view
  • Month navigation with arrows
  • Date selection with visual feedback
  • Effective date display
  • Auto-set to tomorrow by default

Scroller Variant

Features:

  • iOS-style scroll wheel interface
  • Touch-friendly month/day/year selection
  • Smooth animations and transitions
  • Mouse wheel support for desktop
  • Momentum scrolling on mobile

Range (PTDateRange)

Features:

  • One modal, range mode
  • Tap start, tap end, confirm with footer
  • Hover preview while assembling the range
  • Clear / Cancel from footer

Additional Test Cases

Testing Instructions

Calendar Modal: Click dates to select, use arrow buttons to navigate months. Notice the auto-set to tomorrow feature.

Scroller Modal: Use mouse wheel or touch gestures to scroll through months, days, and years. Test momentum scrolling on mobile.

Range: Tap a start date, tap an end date, then confirm via the footer. Hover preview highlights the in-between cells while you assemble it.

Interactions: Test backdrop clicks, escape key, and various selection modes.

Español


Terms Of Use
Privacy Policy
Regulatory Documents
Cookie Preferences

Copyright 2026. All rights reserved. Pogo Energy

LLC. PUCT No. 10228.