@@ -179,7 +179,11 @@ function splitModelKey(value: string): ModelSelection | null {
179179 } ;
180180}
181181
182- export function scheduleLabel ( schedule : ScheduledTaskSchedule ) : string {
182+ function scheduleTimeZoneLabel ( timeZone : string | undefined ) {
183+ return timeZone === "Etc/UTC" ? "UTC" : timeZone ;
184+ }
185+
186+ export function scheduleLabel ( schedule : ScheduledTaskSchedule , timeZone ?: string ) : string {
183187 if ( schedule . type === "webhook" ) return "On webhook" ;
184188 if ( schedule . type === "interval" ) {
185189 const minutes = schedule . everyMs / 60_000 ;
@@ -194,7 +198,8 @@ export function scheduleLabel(schedule: ScheduledTaskSchedule): string {
194198 : weekdays . length === 5 && weekdays . every ( ( day ) => day >= 1 && day <= 5 )
195199 ? "Weekdays"
196200 : weekdays . map ( ( day ) => WEEKDAY_LABELS [ day ] ) . join ( ", " ) ;
197- return `${ days } at ${ schedule . timeOfDay } ` ;
201+ const zone = scheduleTimeZoneLabel ( timeZone ) ;
202+ return `${ days } at ${ schedule . timeOfDay } ${ zone === undefined ? "" : ` ${ zone } ` } ` ;
198203}
199204
200205/**
@@ -364,6 +369,7 @@ function ScheduledTaskEnvironmentList({
364369 return {
365370 environment,
366371 connected : index >= 0 ,
372+ timeZone : data ?. timeZone ,
367373 tasks : data ?. tasks . filter ( ( task ) =>
368374 matchesScheduledTaskScope ( scope , environment . environmentId , task . projectId ) ,
369375 ) ,
@@ -405,7 +411,7 @@ function ScheduledTaskEnvironmentList({
405411
406412 return (
407413 < SettingsGroup >
408- { populated . map ( ( { environment, tasks } ) => {
414+ { populated . map ( ( { environment, tasks, timeZone } ) => {
409415 const { primary, secondary } = settingsScopeEnvironmentLabels ( environment , environments ) ;
410416 const transport = environmentTransportLabel ( environment ) ;
411417 return (
@@ -435,6 +441,7 @@ function ScheduledTaskEnvironmentList({
435441 key = { task . id }
436442 environmentId = { environment . environmentId }
437443 task = { task }
444+ timeZone = { timeZone }
438445 onEdit = { ( ) => onEdit ( environment . environmentId , task ) }
439446 />
440447 ) ) }
@@ -550,6 +557,7 @@ function ScheduledTaskEnvironmentSection({
550557 key = { task . id }
551558 environmentId = { environment . environmentId }
552559 task = { task }
560+ timeZone = { tasksQuery . data ?. timeZone }
553561 onEdit = { ( ) => onEdit ( environment . environmentId , task ) }
554562 />
555563 ) )
@@ -563,10 +571,12 @@ function ScheduledTaskEnvironmentSection({
563571function ScheduledTaskRow ( {
564572 environmentId,
565573 task,
574+ timeZone,
566575 onEdit,
567576} : {
568577 readonly environmentId : EnvironmentId ;
569578 readonly task : ScheduledTask ;
579+ readonly timeZone : string | undefined ;
570580 readonly onEdit : ( ) => void ;
571581} ) {
572582 const canOperate = useAtomValue (
@@ -611,7 +621,7 @@ function ScheduledTaskRow({
611621 status = {
612622 < div className = "flex flex-wrap items-center gap-2" >
613623 < span >
614- { scheduleLabel ( task . schedule ) } ·{ " " }
624+ { scheduleLabel ( task . schedule , timeZone ) } ·{ " " }
615625 { ! task . enabled ? (
616626 "Paused"
617627 ) : isWebhook ? (
@@ -998,6 +1008,7 @@ function ScheduledTaskEditorForm({
9981008 draft . editingId !== null &&
9991009 tasksQuery . data !== null &&
10001010 ! tasksQuery . data . tasks . some ( ( entry ) => entry . id === draft . editingId ) ;
1011+ const runAtZone = scheduleTimeZoneLabel ( tasksQuery . data ?. timeZone ) ;
10011012 const liveTask = tasksQuery . data
10021013 ? ( tasksQuery . data . tasks . find ( ( entry ) => entry . id === draft . editingId ) ?? null )
10031014 : task ;
@@ -1501,6 +1512,9 @@ function ScheduledTaskEditorForm({
15011512 setDraft ( ( current ) => ( { ...current , timeOfDay : event . target . value } ) )
15021513 }
15031514 />
1515+ { runAtZone === undefined ? null : (
1516+ < span className = "text-xs text-muted-foreground" > { runAtZone } </ span >
1517+ ) }
15041518 < span className = "text-xs text-muted-foreground" > on</ span >
15051519 </ div >
15061520 < ToggleGroup
0 commit comments