Context
Currently, in moments.ts, SERVICE_MOMENTS contains hardcoded timezone values pointing to "America/Argentina/Buenos_Aires".
export const SERVICE_MOMENTS: {
...
timezone: Timezone;
}[] = [
{
zzz_id: "BREAKFAST",
...
timezone: "America/Argentina/Buenos_Aires",
},
...
];
We recently made project timezones dynamic so they are loaded from the database (zzz_timezone on the project schema) and consumed dynamically in the client via Zustand useProjectStore.getState().selectedProject?.zzz_timezone.
However, the static list of SERVICE_MOMENTS and the getMomentConfig helper still contain the hardcoded "America/Argentina/Buenos_Aires" timezone fallback.
Proposed Change
Refactor SERVICE_MOMENTS or how it's consumed in components (e.g., booking, order calendar) to resolve the timezone dynamically from the active project.
- Transform
SERVICE_MOMENTS into a function/hook, or dynamically map it at runtime when listing/rendering.
- Ensure all screens relying on
SERVICE_MOMENTS use the correct timezone from the active project.
Context
Currently, in moments.ts,
SERVICE_MOMENTScontains hardcoded timezone values pointing to"America/Argentina/Buenos_Aires".We recently made project timezones dynamic so they are loaded from the database (
zzz_timezoneon the project schema) and consumed dynamically in the client via ZustanduseProjectStore.getState().selectedProject?.zzz_timezone.However, the static list of
SERVICE_MOMENTSand thegetMomentConfighelper still contain the hardcoded"America/Argentina/Buenos_Aires"timezone fallback.Proposed Change
Refactor
SERVICE_MOMENTSor how it's consumed in components (e.g., booking, order calendar) to resolve the timezone dynamically from the active project.SERVICE_MOMENTSinto a function/hook, or dynamically map it at runtime when listing/rendering.SERVICE_MOMENTSuse the correct timezone from the active project.