Migrate to dayjs and Astro 4.0
This commit is contained in:
@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user