There still exists an issue with one Adobe led library ; @international-dates don't seem to compile their sourcemaps correctly. I don't think this is something I can fix however, and it may require hacks and workarounds to solve from what I've gathered
32 lines
926 B
Vue
32 lines
926 B
Vue
<script lang="ts" setup>
|
|
import { useCalendar } from '@/stores/CalendarStore'
|
|
import { storeToRefs } from 'pinia'
|
|
import { computed } from 'vue'
|
|
|
|
import { areDatesIdentical } from '@/models/Date'
|
|
|
|
const { defaultDate, selectedDate } = storeToRefs(useCalendar())
|
|
const { jumpToDefaultDate, getFormattedDateTitle } = useCalendar()
|
|
|
|
const defaultDateFormatted = getFormattedDateTitle(defaultDate.value, true)
|
|
|
|
const isDefaultDate = computed(() => {
|
|
return areDatesIdentical(selectedDate.value, defaultDate.value)
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<UiTooltipProvider :delay-duration="250">
|
|
<UiTooltip>
|
|
<UiTooltipTrigger as-child>
|
|
<UiButton size="sm" :disabled="isDefaultDate" @click="jumpToDefaultDate">
|
|
Aujourd'hui
|
|
</UiButton>
|
|
</UiTooltipTrigger>
|
|
<UiTooltipContent>
|
|
<p>{{ defaultDateFormatted }}</p>
|
|
</UiTooltipContent>
|
|
</UiTooltip>
|
|
</UiTooltipProvider>
|
|
</template>
|