@@ -79,6 +79,7 @@ import {
7979 type DraftState ,
8080 type ScheduleMode ,
8181 type WorkspaceMode ,
82+ scheduleTimeZoneLabel ,
8283} from "./scheduledTasksSettings.logic" ;
8384import { Label } from "../ui/label" ;
8485import { Menu , MenuTrigger , MenuPopup , MenuItem , MenuSeparator } from "../ui/menu" ;
@@ -179,7 +180,7 @@ function splitModelKey(value: string): ModelSelection | null {
179180 } ;
180181}
181182
182- export function scheduleLabel ( schedule : ScheduledTaskSchedule ) : string {
183+ export function scheduleLabel ( schedule : ScheduledTaskSchedule , timeZone ?: string ) : string {
183184 if ( schedule . type === "webhook" ) return "On webhook" ;
184185 if ( schedule . type === "interval" ) {
185186 const minutes = schedule . everyMs / 60_000 ;
@@ -194,7 +195,8 @@ export function scheduleLabel(schedule: ScheduledTaskSchedule): string {
194195 : weekdays . length === 5 && weekdays . every ( ( day ) => day >= 1 && day <= 5 )
195196 ? "Weekdays"
196197 : weekdays . map ( ( day ) => WEEKDAY_LABELS [ day ] ) . join ( ", " ) ;
197- return `${ days } at ${ schedule . timeOfDay } ` ;
198+ const zone = scheduleTimeZoneLabel ( timeZone ) ;
199+ return `${ days } at ${ schedule . timeOfDay } ${ zone === null ? "" : ` ${ zone } ` } ` ;
198200}
199201
200202/**
@@ -357,6 +359,7 @@ function ScheduledTaskEnvironmentList({
357359 return {
358360 environment,
359361 connected : index >= 0 ,
362+ timeZone : data ?. timeZone ,
360363 tasks : data ?. tasks . filter ( ( task ) =>
361364 matchesScheduledTaskScope ( scope , environment . environmentId , task . projectId ) ,
362365 ) ,
@@ -399,7 +402,7 @@ function ScheduledTaskEnvironmentList({
399402
400403 return (
401404 < SettingsGroup >
402- { populated . map ( ( { environment, tasks } ) => {
405+ { populated . map ( ( { environment, tasks, timeZone } ) => {
403406 const { primary, secondary } = settingsScopeEnvironmentLabels ( environment , environments ) ;
404407 const transport = environmentTransportLabel ( environment ) ;
405408 return (
@@ -429,6 +432,7 @@ function ScheduledTaskEnvironmentList({
429432 key = { task . id }
430433 environmentId = { environment . environmentId }
431434 task = { task }
435+ timeZone = { timeZone }
432436 onEdit = { ( ) => onEdit ( environment . environmentId , task ) }
433437 />
434438 ) ) }
@@ -545,6 +549,7 @@ function ScheduledTaskEnvironmentSection({
545549 key = { task . id }
546550 environmentId = { environment . environmentId }
547551 task = { task }
552+ timeZone = { tasksQuery . data ?. timeZone }
548553 onEdit = { ( ) => onEdit ( environment . environmentId , task ) }
549554 />
550555 ) )
@@ -558,10 +563,12 @@ function ScheduledTaskEnvironmentSection({
558563function ScheduledTaskRow ( {
559564 environmentId,
560565 task,
566+ timeZone,
561567 onEdit,
562568} : {
563569 readonly environmentId : EnvironmentId ;
564570 readonly task : ScheduledTask ;
571+ readonly timeZone : string | undefined ;
565572 readonly onEdit : ( ) => void ;
566573} ) {
567574 const canOperate = useAtomValue (
@@ -606,7 +613,7 @@ function ScheduledTaskRow({
606613 status = {
607614 < div className = "flex flex-wrap items-center gap-2" >
608615 < span >
609- { scheduleLabel ( task . schedule ) } ·{ " " }
616+ { scheduleLabel ( task . schedule , timeZone ) } ·{ " " }
610617 { ! task . enabled
611618 ? "Paused"
612619 : isWebhook
@@ -989,6 +996,7 @@ function ScheduledTaskEditorForm({
989996 draft . editingId !== null &&
990997 tasksQuery . data !== null &&
991998 ! tasksQuery . data . tasks . some ( ( entry ) => entry . id === draft . editingId ) ;
999+ const runAtZone = scheduleTimeZoneLabel ( tasksQuery . data ?. timeZone ) ;
9921000 const liveTask = tasksQuery . data
9931001 ? ( tasksQuery . data . tasks . find ( ( entry ) => entry . id === draft . editingId ) ?? null )
9941002 : task ;
@@ -1492,6 +1500,9 @@ function ScheduledTaskEditorForm({
14921500 setDraft ( ( current ) => ( { ...current , timeOfDay : event . target . value } ) )
14931501 }
14941502 />
1503+ { runAtZone === null ? null : (
1504+ < span className = "text-xs text-muted-foreground" > { runAtZone } </ span >
1505+ ) }
14951506 < span className = "text-xs text-muted-foreground" > on</ span >
14961507 </ div >
14971508 < ToggleGroup
0 commit comments