Date.vue 496 B

12345678910111213141516171819202122232425
  1. <!--
  2. Date formatée
  3. -->
  4. <template>
  5. <span>{{ datesFormatted }}</span>
  6. </template>
  7. <script setup lang="ts">
  8. import DateUtils from '~/services/utils/dateUtils'
  9. import { computed } from '@vue/reactivity'
  10. import type { ComputedRef } from '@vue/reactivity'
  11. const props = defineProps({
  12. data: {
  13. type: [String, Array],
  14. required: false,
  15. default: null,
  16. },
  17. })
  18. const datesFormatted: ComputedRef<string> = computed(() => {
  19. return DateUtils.format(props.data, 'DD/MM/YYYY')
  20. })
  21. </script>