Date.vue 456 B

123456789101112131415161718192021222324
  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, ComputedRef} from "@vue/reactivity";
  10. const props = defineProps({
  11. data: {
  12. type: [String, Array],
  13. required: false,
  14. default: null
  15. }
  16. })
  17. const datesFormatted: ComputedRef<string> = computed(() => {
  18. return DateUtils.format(props.data, 'DD/MM/YYYY')
  19. })
  20. </script>