Skip to content

Commit

Permalink
feat: ✨ add luxon for fix utc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nutfdt committed Jun 7, 2024
1 parent 8ab608c commit d82bcda
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
26 changes: 26 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@gouvminint/vue-dsfr": "^5.8.0",
"@vueuse/core": "^10.7.2",
"axios": "^1.6.7",
"luxon": "^3.4.4",
"pinia": "^2.1.7",
"stylelint-config-recommended-vue": "^1.5.0",
"swiper": "^11.0.6",
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/GuideContactExpert/ExpertSituation.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts" setup>
import { DsfrButton } from '@gouvminint/vue-dsfr'
import { useRouter } from 'vue-router'
import { DateTime } from 'luxon'
const router = useRouter()
Expand Down Expand Up @@ -48,14 +49,13 @@ function buildMailto (email: string) {
}
const currentPhone = computed(() => {
const currentHour = new Date().getUTCHours() + 1
const currentHour = parseInt(DateTime.now().setZone('Europe/Paris').toFormat('HH'), 10)
if (currentHour >= 8 && currentHour < 18) {
return IRCGN.fixe
} else {
return IRCGN.phone
}
})
</script>

<template>
Expand Down

0 comments on commit d82bcda

Please sign in to comment.