toga-ai 1.0.1144 → 1.0.1145
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/knowledge/1.0/standards/backend-php.md +11 -1
- package/knowledge/1.0/standards/frontend.md +5 -1
- package/knowledge/2.0/standards/backend-php.md +3 -4
- package/knowledge/2.0/standards/frontend.md +1 -1
- package/knowledge/org/knowledge-map.md +1 -0
- package/knowledge/org/standards/time-zones.md +24 -0
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ project: Library
|
|
|
5
5
|
client: shared
|
|
6
6
|
type: standard
|
|
7
7
|
status: active
|
|
8
|
-
updated: 2026-10-
|
|
8
|
+
updated: 2026-10-24
|
|
9
9
|
owners: [jcardinal, rgirish, mhammontree, ajean, bala]
|
|
10
10
|
files: []
|
|
11
11
|
related:
|
|
@@ -569,6 +569,16 @@ Never persist a generated file on local disk to hand to a *second* request. Our
|
|
|
569
569
|
several instances behind a shared load balancer, so per-instance paths like `/var/www/cache`
|
|
570
570
|
are not shared and the follow-up request intermittently 404s. One request, start to finish.
|
|
571
571
|
|
|
572
|
+
## Time zones — store Central, convert for display
|
|
573
|
+
|
|
574
|
+
**Hard rule (team-wide):** every date and time stored in the database must be pre-converted to Central time (`America/Chicago`). See [org/standards/time-zones.md](../../org/standards/time-zones.md).
|
|
575
|
+
|
|
576
|
+
1.0 specifics (verified in `library`):
|
|
577
|
+
- `library/_.php` calls `date_default_timezone_set('America/Chicago')`, so `date()`, `time()`-based values and `App_Date::getTimeNow()` are naive Central. Do not change the default zone in app code.
|
|
578
|
+
- Convert with `App_Date::convertToTimezone($datetime, $format, $phpTimezone)` (outputs in the target zone, restores the default) or `App_Date::convertTimezone()` / `convertTimezoneToEpoch($datetime, $inputTimezone)`. Convert inbound UTC feeds to Central before saving; convert only for display or an outbound payload.
|
|
579
|
+
- `App_Date::getTimeNow(true)` adds the local user offset for display; never save that value.
|
|
580
|
+
- 1.0 has no viewer-zone setting layer; display zone logic is app-specific.
|
|
581
|
+
|
|
572
582
|
## Documentation
|
|
573
583
|
|
|
574
584
|
- Keep code well-documented with DocBlocks and usage examples.
|
|
@@ -5,7 +5,7 @@ project: Library
|
|
|
5
5
|
client: shared
|
|
6
6
|
type: standard
|
|
7
7
|
status: active
|
|
8
|
-
updated: 2026-
|
|
8
|
+
updated: 2026-10-24
|
|
9
9
|
owners: [jcardinal]
|
|
10
10
|
files: []
|
|
11
11
|
related:
|
|
@@ -74,3 +74,7 @@ When retrofitting light/dark onto a legacy sheet, four rules turn a guessing gam
|
|
|
74
74
|
Two things are **never** tokenised: HTML destined for an **email** (email clients cannot resolve custom properties) and colours deliberately matched to third-party embedded content (e.g. an iframe's canvas colour, to prevent a white flash on load).
|
|
75
75
|
|
|
76
76
|
Reference implementation (tools App-Wide Colour Theme) — see frontend-cases.md.
|
|
77
|
+
|
|
78
|
+
## Time zones
|
|
79
|
+
|
|
80
|
+
Hard rule (team-wide): dates and times are stored in Central (`America/Chicago`). Convert user input to Central before sending; convert from Central only to display. Never treat a server datetime as browser-local or UTC. See [org/standards/time-zones.md](../../org/standards/time-zones.md) and [backend-php.md § Time zones](backend-php.md#time-zones--store-central-convert-for-display).
|
|
@@ -1030,10 +1030,9 @@ See: 2.0/apps/worker2/features/cross-account-aws-access.md (role model),
|
|
|
1030
1030
|
|
|
1031
1031
|
## Time zones — store Chicago, convert for the user
|
|
1032
1032
|
|
|
1033
|
-
- **Hard rule
|
|
1034
|
-
-
|
|
1035
|
-
- The
|
|
1036
|
-
- The user's zone is a **setting** (slug `time-zone`, settings layer): global default `America/Chicago` (`Core.DefaultGlobalSettings`), a client can override, a user can override. Only the **display** converts; storage never does.
|
|
1033
|
+
- **Hard rule (team-wide, all frameworks):** [org/standards/time-zones.md](../../org/standards/time-zones.md). Store Central (`America/Chicago`); convert only for display.
|
|
1034
|
+
- 2.0 specifics: the api2 `Config/*.ini` files set `timezone = "America/Chicago"`, so PHP and SQL datetimes are naive Chicago. Desk Dispatch (TRUE-82916) working hours and time off are Central clock times.
|
|
1035
|
+
- The viewer zone is a **setting** (slug `time-zone`, settings layer): global default `America/Chicago` (`Core.DefaultGlobalSettings`), client and user can override.
|
|
1037
1036
|
- Resolve with `_Component_SlaCalendar::resolveTimeZone()` (user setting, else client setting, else Core default, else PHP default). `assertStorageZone()` throws if the DB clock and PHP default zone differ — keep them equal.
|
|
1038
1037
|
- The viewer's zone travels the same path as language and currency: api2 resolves the `time-zone` setting through the settings cascade at token mint (user, else client, else global Chicago), embeds it in the token, and returns `audience.timeZone` on every answer and refresh. blox keeps it in a session store (`useSessionTimeZone`, like `useSessionCurrency`). Apps read the viewer's zone only from there, never from settings rows.
|
|
1039
1038
|
- Planned (not built yet): the preferred date format and time format settings will travel the same path (token + audience + blox session store).
|
|
@@ -775,7 +775,7 @@ Copy from there rather than reinventing.
|
|
|
775
775
|
|
|
776
776
|
## 25. Time zones — convert from the storage zone — **MUST**
|
|
777
777
|
|
|
778
|
-
- **Hard rule
|
|
778
|
+
- **Hard rule (team-wide, all frameworks):** [org/standards/time-zones.md](../../org/standards/time-zones.md). The front end converts the user's zone to Central before sending; convert back only for display. Desk Dispatch (TRUE-82916) working hours and time off are Central clock times.
|
|
779
779
|
- The server stores and returns datetimes in **Chicago time** (`America/Chicago`), with no zone marker. **Never treat a server datetime as browser-local or UTC** (`new Date("2026-10-24 09:00:00")` is wrong).
|
|
780
780
|
- Convert **explicitly from `America/Chicago`** to the user's zone, using one shared helper (desk: `src/utils/serverTime.ts`). Send datetimes back in Chicago time.
|
|
781
781
|
- The user's zone is a setting (`time-zone`: user, else client, else global Chicago default). api2 resolves it at token mint and returns `audience.timeZone` on every answer and refresh; blox keeps it in a session store (`useSessionTimeZone`, like `useSessionCurrency`). Read the viewer's zone only from there; never read settings rows yourself and never hard-code it.
|
|
@@ -24,6 +24,7 @@ Where each kind of knowledge lives. The prompt's taxonomy (product, architecture
|
|
|
24
24
|
| infrastructure | `devops` agent + AWS docs (fetched live); deploy notes in workflow docs |
|
|
25
25
|
| security | `rules/toga/common/security.md` + `cso` |
|
|
26
26
|
| decisions | `knowledge/org/decisions/` (ADRs) |
|
|
27
|
+
| team-wide standards (all frameworks) | `knowledge/org/standards/` (e.g. `time-zones.md`: store Central) |
|
|
27
28
|
| troubleshooting | gotchas attached to the owning team-KB feature/workflow doc + prod Logs |
|
|
28
29
|
|
|
29
30
|
## Why not build all ten folders now
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Time zones — team-wide hard rule (all frameworks, all repos)
|
|
2
|
+
|
|
3
|
+
Applies to 1.0, 2.0, and standalone apps. Single source; framework docs link here and add only their own details.
|
|
4
|
+
|
|
5
|
+
## Rule
|
|
6
|
+
|
|
7
|
+
**Every date and time stored in a database must be pre-converted to Central time (`America/Chicago`) before it is saved.**
|
|
8
|
+
|
|
9
|
+
- The caller (front end, worker, import, API client) converts from the source zone to Central before the write. The stored value is never UTC and never a user's local time.
|
|
10
|
+
- Stored values carry no zone marker. Read them as Central, never as browser-local or UTC.
|
|
11
|
+
- Convert from Central to the viewer's zone **only for display**. Storage never converts.
|
|
12
|
+
- Inbound external timestamps (UTC feeds such as NetSuite REST `lastModifiedDate`) convert to Central on the way in. Outbound feeds convert back out explicitly.
|
|
13
|
+
- Working hours, time off, schedules: stored as Central clock times.
|
|
14
|
+
|
|
15
|
+
## Viewer zone is a setting
|
|
16
|
+
|
|
17
|
+
- Global default `America/Chicago`; a client can override; a user can override (user, else client, else global).
|
|
18
|
+
- Only the display layer reads it. How each framework delivers it is framework-specific (see below).
|
|
19
|
+
|
|
20
|
+
## Framework details
|
|
21
|
+
|
|
22
|
+
- 2.0: [backend-php.md § Time zones](../../2.0/standards/backend-php.md#time-zones--store-chicago-convert-for-the-user) and [frontend.md § 25](../../2.0/standards/frontend.md#25-time-zones--convert-from-the-storage-zone--must) (`audience.timeZone`, blox `useSessionTimeZone`).
|
|
23
|
+
- 1.0: [backend-php.md § Time zones](../../1.0/standards/backend-php.md#time-zones--store-central-convert-for-display) and [frontend.md](../../1.0/standards/frontend.md).
|
|
24
|
+
- Standalone apps: same rule; no framework helper, so convert explicitly.
|
package/package.json
CHANGED