getEvent
Looks up an event in the calendar store by its id. Returns undefined when no event matches.
Usage
getEvent(id: string | number): CalendarEvent | undefined;
| Parameter | Type | Description |
|---|---|---|
id | string | number | Event id to look up |
Example
<script>
import { Calendar } from "@wx/svelte-calendar";
let api;
function logEvent() {
const event = api.getEvent(42);
console.log(event);
}
</script>
<Calendar bind:this={api} {events} />