Migrate to dayjs and Astro 4.0

This commit is contained in:
2023-12-07 00:17:32 +01:00
parent 505ee26622
commit 311856415e
24 changed files with 731 additions and 980 deletions

View File

@ -1,10 +1,9 @@
<script lang="ts">
import {Button, Input, Label, Modal} from "flowbite-svelte";
import moment from "moment";
import {createEventDispatcher} from "svelte";
import ErrorModal from "../../components/ErrorModal.svelte";
import {eventRepo} from "../../../repo/repo.js";
import type {SWEvent} from "../../../types/event.js";
import * as dayjs from "dayjs";
export let open = false;
const dispatch = createEventDispatcher();
@ -14,9 +13,9 @@
let eventName = "";
let start = "";
$: startDate = moment(start)
$: startDate = dayjs(start)
let end = "";
$: endDate = moment(end)
$: endDate = dayjs(end)
$: canSubmit = eventName.length > 0 && startDate.isValid() && endDate.isValid() && startDate.isBefore(endDate)