You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,7 +145,7 @@ pnpm test
145
145
### Date, Day Strings, and Timezones
146
146
147
147
- Prefer the shared helpers in `shared/src/utils/timezone.ts`, exported through `@workspace/shared`, for day-string and timezone-aware date logic.
148
-
- Use `isDayString`, `addDays`, `compareDays`, `dayToPickerDate`, and `pickerDateToDay` for `YYYY-MM-DD` calendar-day strings.
148
+
- Use `isDayString`, `addDays`, `compareDays`, `dayToPickerDate`, and `localDateToDay` for `YYYY-MM-DD` calendar-day strings.
149
149
- Use `todayInZone`, `instantToDay`, `instantHourMinute`, `dayToUtcRange`, and `dayRangeToUtcRange` when a user's timezone matters.
150
150
- On the server, load the user's timezone with `SparkyFitnessServer/utils/timezoneLoader.js` before deriving "today", bucketing timestamps by day, or building day-based query ranges.
151
151
- Avoid ad hoc UTC date extraction such as `toISOString().split('T')[0]` for user-facing or business-logic dates. That pattern silently shifts dates near timezone boundaries and is not a substitute for timezone-aware day handling.
-**Constants**: `MEASUREMENT_PRECISION`/`getPrecision()` for decimal formatting, `CALORIE_CALCULATION_CONSTANTS`/`ACTIVITY_MULTIPLIERS` for step/calorie math
0 commit comments