fix(dates): invalid UTC in RRULE

This commit is contained in:
2026-09-16 11:35:01 +02:00
parent f3cd3b8086
commit 8007468abd
2 changed files with 23 additions and 3 deletions
+7 -3
View File
@@ -1,24 +1,28 @@
<script setup lang="ts">
import { parseDateInput, formatDateInput } from "@/lib/dates";
const emit = defineEmits<(e: "input"|"change", value: Date) => void>();
const date = defineModel<Date>({ required: true });
function onInput(event: Event) {
const inputValue = (event.target as HTMLInputElement).value;
date.value = new Date(inputValue);
date.value = parseDateInput(inputValue);
emit('input', date.value);
}
function onChange(event: Event) {
const inputValue = (event.target as HTMLInputElement).value;
date.value = new Date(inputValue);
date.value = parseDateInput(inputValue);
emit('change', date.value);
}
</script>
<template>
<input
:value="date.toISOString().substring(0, 10)"
:value="formatDateInput(date)"
type="date"
@input="onInput"
@change="onChange"