Skip to main content

cancel

Description

a function called on closing the Month view after date selection

Type

function

Example

<script>
import { Month, Button } from "wx-svelte-core";

let value = new Date();
let showMonth = false;
const show = () => {
showMonth = true;
};
const select = date => {
value = date;
};
const cancel = () => {
showMonth = false;
};

</script>

<div class="demo-box" style="width: 300px">
<div style="margin: 20px;">{value}</div>
<div style="margin: 20px;">
<Button click={show}>Open month</Button>
</div>
{#if showMonth}
<Month {value} part="normal" current={value} {select} {cancel} />
{/if}
</div>

Related article: Handling date selection