* chore: add a formatter, matching the style this repo already writes
singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.
Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* style: format with prettier (252 files)
Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* chore: teach git blame to skip the reformat
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
formatPrice and formatAdoptionFee now use Intl.NumberFormat(locale, { style: "currency",
currency: APP_CURRENCY }) so the symbol and number formatting are locale-aware.
APP_CURRENCY reads from NEXT_PUBLIC_APP_CURRENCY env (default "USD"), making the
deployment currency a single config value rather than a hardcoded symbol.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
formatPetAge and formatPetAgeShort now accept a t() function so callers
pass their locale context instead of receiving hardcoded English. Adds 7
translation keys to the public namespace (petAgeMonths, petAgeYears,
petAgeYearsMonths, petAgeShortMonths, etc.) with proper plural forms and
natural phrasing for DE/FR/ES/JA/ZH/KO/TR/AR. Also adds unnamedPet key
to eliminate the last hardcoded English fallback in the booking modal,
and routes OG image price/fee strings through formatPrice/formatAdoptionFee
instead of inline $ calculations.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the hardcoded English strings ("Today", "Tomorrow", "In 7 days")
in formatRelativeDate with Intl.RelativeTimeFormat, so German users see
"heute/morgen/gestern", French see "aujourd'hui/demain/hier", etc.
Updates all call sites (pets list, health log, vaccinations) to pass
locale. Also routes sitter per-day price through formatAdoptionFee to
eliminate a rogue inline $-calculation in the Find page.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All four functions were untested despite being called from production
routes and every page that displays product/adoption prices.
12 new assertions covering: zero/whole-dollar/cent amounts, null/0/"Free"
adoption fee edge cases, ISO date locale formatting, and datetime output
shape. Suite grows 534 → 546.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SignalHistoryTimeline hardcoded 'en-US', so non-English users on
the pet profile saw English dates regardless of their locale.
- SignalHistoryTimeline: route through formatIsoDate (uses runtime
locale) for consistency with the rest of the app
- formatDateShort: accept optional locale param so localized server
components can pass the resolved locale; default unchanged
- Public pet profile (under /[locale]/): pass locale to formatDateShort
so 'Born …' renders in the visitor's language
- Tests: cover both en and ja explicitly so a non-en CI runtime
doesn't break them (the prior implicit dependency on en-locale
CI is what made the suite fragile)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Health history table now shows a hover-revealed edit (pencil) icon per row.
Clicking it navigates to /health/log?date=YYYY-MM-DD, where the log page now
accepts a ?date= search param — letting owners correct past entries via the
same upsert API. When editing a past date with no prior entry, the date field
is pre-filled. Heading and description text update contextually.
Also adds 2 edge-case tests for formatRelativeDate (30 days past/future)
to confirm plural phrasing is stable.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Health log page now fetches the most recent prior log (parallel with today's
query) and shows physical metrics as a one-line context strip: "Last logged
yesterday: 25.0 kg · 38.5°C · 80 bpm". Only shown when physical metrics exist,
helping owners notice changes before they log.
Also adds 10 tests for formatPetAgeShort and formatPetAge (null, <1mo, N months,
whole years, years+months) using vi.setSystemTime for determinism.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
formatRelativeDate used local midnight for the target date but all other
date operations in the codebase use UTC. For users in non-UTC timezones,
"today" could show as "yesterday". Fixed by using UTC midnight on both
sides of the comparison.
Also adds 11 unit tests for formatDateShort, formatWeight,
formatTemperature, and formatRelativeDate; and 2 missing pet-signal
cases (no metrics + overdue vaccinations → concern; high anxiety →
out-of-range watch).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>