Skip to content

Commit

Permalink
Merge pull request #291 from ymaheshwari1/#284
Browse files Browse the repository at this point in the history
Improved: dateTime method to honor the timeZone selected for the current user(#284)
  • Loading branch information
ymaheshwari1 authored Apr 26, 2024
2 parents b05740c + 9069bed commit d1ad543
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/DxpAppVersionInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
<script setup lang="ts">
import { IonButton } from '@ionic/vue';
import { DateTime } from 'luxon';
import { appContext, translate } from 'src';
import { appContext, translate, useUserStore } from 'src';
import { computed } from 'vue';
declare var process: any;
const userStore = useUserStore();
const appState = appContext.config.globalProperties.$store
const pwaState = computed(() => appState.getters['user/getPwaState'])
Expand All @@ -30,5 +32,5 @@ const refreshApp = () => {
const appInfo = (process.env.VUE_APP_VERSION_INFO ? JSON.parse(process.env.VUE_APP_VERSION_INFO) : {}) as any;
const appVersion = appInfo.branch ? (appInfo.branch + "-" + appInfo.revision) : appInfo.tag;
const getDateTime = (time: any) => DateTime.fromMillis(time).toLocaleString(DateTime.DATETIME_MED);
const getDateTime = (time: any) => DateTime.fromMillis(time).setZone(userStore.currentTimeZoneId).toLocaleString(DateTime.DATETIME_MED);
</script>

0 comments on commit d1ad543

Please sign in to comment.