Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/lib/components/schedule/schedule-day-of-month-view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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();
</script>

<div class="flex flex-col gap-4">
Expand Down
17 changes: 13 additions & 4 deletions src/lib/components/schedule/schedule-day-of-week-view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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();
</script>

<div class="flex flex-col gap-4">
Expand Down
28 changes: 19 additions & 9 deletions src/lib/components/schedule/schedules-interval-view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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<ScheduleOffsetUnit>('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';
Expand All @@ -31,7 +41,7 @@
phase = parseInt(offset).toString() + 's';
}
}
}
});
</script>

<div class="flex flex-col gap-4">
Expand Down
19 changes: 14 additions & 5 deletions src/lib/components/schedule/schedules-time-view.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
</script>

<div class="flex flex-col gap-4">
Expand Down
Loading