diff --git a/src/lib/components/schedule/schedule-day-of-month-view.svelte b/src/lib/components/schedule/schedule-day-of-month-view.svelte
index 3731bb6b04..3c77340926 100644
--- a/src/lib/components/schedule/schedule-day-of-month-view.svelte
+++ b/src/lib/components/schedule/schedule-day-of-month-view.svelte
@@ -5,11 +5,21 @@
import SchedulesTimeView from './schedules-time-view.svelte';
- export let daysOfMonth: number[];
- export let months: string[];
- export let hour: string;
- export let minute: string;
- export let timezoneName: string;
+ interface Props {
+ daysOfMonth: number[];
+ months: string[];
+ hour: string;
+ minute: string;
+ timezoneName: string;
+ }
+
+ let {
+ daysOfMonth = $bindable(),
+ months = $bindable(),
+ hour = $bindable(),
+ minute = $bindable(),
+ timezoneName,
+ }: Props = $props();
diff --git a/src/lib/components/schedule/schedule-day-of-week-view.svelte b/src/lib/components/schedule/schedule-day-of-week-view.svelte
index 03c296009e..c6278ad966 100644
--- a/src/lib/components/schedule/schedule-day-of-week-view.svelte
+++ b/src/lib/components/schedule/schedule-day-of-week-view.svelte
@@ -4,10 +4,19 @@
import SchedulesTimeView from './schedules-time-view.svelte';
- export let daysOfWeek: string[];
- export let hour: string;
- export let minute: string;
- export let timezoneName: string;
+ interface Props {
+ daysOfWeek: string[];
+ hour: string;
+ minute: string;
+ timezoneName: string;
+ }
+
+ let {
+ daysOfWeek = $bindable(),
+ hour = $bindable(),
+ minute = $bindable(),
+ timezoneName,
+ }: Props = $props();
diff --git a/src/lib/components/schedule/schedules-interval-view.svelte b/src/lib/components/schedule/schedules-interval-view.svelte
index d4f06a0172..4cd01d9534 100644
--- a/src/lib/components/schedule/schedules-interval-view.svelte
+++ b/src/lib/components/schedule/schedules-interval-view.svelte
@@ -5,21 +5,31 @@
import { translate } from '$lib/i18n/translate';
import type { ScheduleOffsetUnit } from '$lib/types/schedule';
- export let days = '';
- export let hour = '';
- export let minute = '';
- export let second = '';
- export let phase = '';
+ interface Props {
+ days?: string;
+ hour?: string;
+ minute?: string;
+ second?: string;
+ phase?: string;
+ }
+
+ let {
+ days = $bindable(''),
+ hour = $bindable(''),
+ minute = $bindable(''),
+ second = $bindable(''),
+ phase = $bindable(''),
+ }: Props = $props();
- let offset = '';
- let offsetUnit: ScheduleOffsetUnit = 'min';
+ let offset = $state('');
+ let offsetUnit = $state
('min');
const error = (x: string) => {
if (x) return isNaN(parseInt(x));
return false;
};
- $: {
+ $effect(() => {
if (offset) {
if (offsetUnit === 'days') {
phase = (parseInt(offset) * 60 * 60 * 24).toString() + 's';
@@ -31,7 +41,7 @@
phase = parseInt(offset).toString() + 's';
}
}
- }
+ });
diff --git a/src/lib/components/schedule/schedules-time-view.svelte b/src/lib/components/schedule/schedules-time-view.svelte
index c0b3837dc1..fcb1dd3dfb 100644
--- a/src/lib/components/schedule/schedules-time-view.svelte
+++ b/src/lib/components/schedule/schedules-time-view.svelte
@@ -3,14 +3,23 @@
import TimePicker from '$lib/holocene/time-picker.svelte';
import { translate } from '$lib/i18n/translate';
- export let hour = '';
- export let minute = '';
- export let timezoneName: string;
+ interface Props {
+ hour?: string;
+ minute?: string;
+ timezoneName: string;
+ }
- $: timezoneHint =
+ let {
+ hour = $bindable(''),
+ minute = $bindable(''),
+ timezoneName,
+ }: Props = $props();
+
+ const timezoneHint = $derived(
timezoneName.toLowerCase() === 'utc'
? 'Universal Standard Time (UTC)'
- : timezoneName;
+ : timezoneName,
+ );