<script setup lang="ts">
import { onMounted, ref, watch } from 'vue';
import useHistoryViewModel from '../viewmodels/HistoryViewModel';
import moment from 'moment';

const model = useHistoryViewModel();

const date = ref<Date>();

onMounted(() => {
    model.getHistoryData(moment().format('YYYY-MM-DD'));
});

watch(date, (value) => {
    model.getHistoryData(moment(value).format('YYYY-MM-DD'));
});
</script>

<template>
    <div>
        <input type="date" v-model="date" />
    </div>
</template>
