fix(dates): invalid UTC in RRULE
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user