<script>
    import { display, to_secs } from '../time.svelte.js';
    let { timestamp = $bindable() } = $props();

    let datetime = $state(null);

    $effect(() => {
        datetime = display(timestamp);
    });

    $effect(() => {
         timestamp = to_secs(datetime);
    });
</script>

<input type="datetime-local" bind:value={datetime} />