add rule date time

This commit is contained in:
phaichayon
2026-06-25 21:36:36 +07:00
parent 14acee1127
commit 42c8c59947
2 changed files with 30 additions and 0 deletions

View File

@@ -412,6 +412,22 @@ Notes:
---
## Date & Time Formatting Rules
- All date and time rendering must use the shared formatter in `src/lib/date-format.ts`.
- Never use `Date.prototype.toLocaleString()`, `toLocaleDateString()`, `toLocaleTimeString()`, or `Intl.DateTimeFormat()` directly inside React components.
- UI date display standard:
- Date: `YYYY-MM-DD`
- DateTime: `YYYY-MM-DD HH:mm:ss`
- Time: `HH:mm:ss`
- API responses must remain ISO-8601 UTC.
- UI is responsible for formatting.
- Timezone is fixed to `Asia/Bangkok`.
- Calendar system must always use Gregorian (AD), never Buddhist Era (BE).
- All formatting must be deterministic to ensure identical SSR and Client rendering and prevent React hydration mismatches.
---
## Authentication Patterns
### Protected Routes