@icvdeveloper/common-module 0.0.120 → 0.0.122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "v3plus-common-module",
3
3
  "configKey": "v3plusCommonModule",
4
- "version": "0.0.120"
4
+ "version": "0.0.122"
5
5
  }
package/dist/module.mjs CHANGED
@@ -97,10 +97,10 @@ const module = defineNuxtModule({
97
97
  nuxt.options.css.push(join(runtimeDir, "assets/scss/index.css"));
98
98
  }
99
99
  if (nuxt.options.vite.optimizeDeps) {
100
- nuxt.options.vite.optimizeDeps.include = ["nprogress", "date-fns-tz"];
100
+ nuxt.options.vite.optimizeDeps.include = ["nprogress"];
101
101
  } else {
102
102
  nuxt.options.vite.optimizeDeps = {
103
- include: ["nprogress", "date-fns-tz"]
103
+ include: ["nprogress"]
104
104
  };
105
105
  }
106
106
  addImportsDir(join(runtimeDir, "store"));
@@ -1,9 +1,8 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref, toRefs } from "vue";
3
- import { add } from "date-fns";
4
3
  import type { Conference } from "../../models/conference";
5
4
  import { useAgenda } from "../../composables/useAgenda";
6
- import { useDateFormat } from "../../composables/useDateFormat";
5
+ import { usePresentation } from "../../composables/usePresentation";
7
6
  import { usePresenter } from "../../composables/usePresenter";
8
7
  import { useClassBinding } from "../../composables/useClassBinding";
9
8
  import { Presenter } from "../../models/conference";
@@ -50,10 +49,16 @@ const props = withDefaults(defineProps<Props>(), {
50
49
  const { conference } = toRefs(props);
51
50
 
52
51
  const { days, getCombinedTrackList } = useAgenda(conference);
53
- const { formatTimezoneToLocal } = useDateFormat();
52
+ const {
53
+ getPresentationStartTime,
54
+ getPresentationEndTime
55
+ } = usePresentation(conference);
54
56
  const { classBinding } = useClassBinding();
55
57
 
56
58
  // data
59
+ const expandedPres = ref<number>(0);
60
+
61
+ // methods
57
62
  const presentersToComposables = (presenters: Presenter[]) => {
58
63
  const data = [];
59
64
 
@@ -67,9 +72,6 @@ const presentersToComposables = (presenters: Presenter[]) => {
67
72
  return data;
68
73
  };
69
74
 
70
- const expandedPres = ref<number>(0);
71
-
72
- // methods
73
75
  const setPres = (_expanded: number) => {
74
76
  expandedPres.value = _expanded;
75
77
  };
@@ -120,23 +122,9 @@ const isPres = (_presId: number): boolean => {
120
122
  classBinding(classObject, 'timeElement', 'time-width')
121
123
  "
122
124
  >
123
- {{
124
- formatTimezoneToLocal(
125
- presentation.date,
126
- "h:mm",
127
- conference.timezone
128
- )
129
- }}
125
+ {{ getPresentationStartTime(presentation, "h:mm") }}
130
126
  -
131
- {{
132
- formatTimezoneToLocal(
133
- add(new Date(presentation.date), {
134
- seconds: presentation.duration,
135
- }),
136
- "h:mm",
137
- conference.timezone
138
- )
139
- }}
127
+ {{ getPresentationEndTime(presentation, "h:mm") }}
140
128
  </span>
141
129
  <span
142
130
  :class="
@@ -1,9 +1,9 @@
1
1
  <script lang="ts" setup>
2
2
  import { toRefs, computed } from "vue";
3
3
  import { storeToRefs } from "pinia";
4
+ import { DateTime } from "luxon";
4
5
  import { useAgenda } from "../../composables/useAgenda";
5
6
  import { Conference, Sponsor as SponsorType } from "../../models/conference";
6
- import { useDateFormat } from "../../composables/useDateFormat";
7
7
  import { usePresentation } from "../../composables/usePresentation";
8
8
  import { usePresenters } from "../../composables/usePresenters";
9
9
  import CommonAccordion from "../layouts/Accordion.vue";
@@ -44,12 +44,11 @@ const {
44
44
  const {
45
45
  showPresentationTimes,
46
46
  showPresentationEndTimes,
47
+ getPresentationStartTime,
47
48
  getPresentationEndTime,
48
49
  } = usePresentation(conference);
49
50
  const { getPresentersLabel, getSortedPresenters } = usePresenters(conference);
50
51
 
51
- const { formatDate, formatTimezoneToLocal } = useDateFormat();
52
-
53
52
  // computed
54
53
  const presentersContainer = computed(() => {
55
54
  return useAccordion() ? CommonAccordion : "div";
@@ -77,7 +76,9 @@ const presentersContainer = computed(() => {
77
76
  @click="setSelectedDay(day)"
78
77
  >
79
78
  {{ day.name }}
80
- <small v-if="showTabDates(day)">{{ formatDate(day.date) }}</small>
79
+ <small v-if="showTabDates(day)">{{
80
+ DateTime.fromSQL(day.date, { zone: conference.timezone }).toFormat("MMMM d, yyyy")
81
+ }}</small>
81
82
  </button>
82
83
  </div>
83
84
 
@@ -215,22 +216,17 @@ const presentersContainer = computed(() => {
215
216
  class="font-light mb-3"
216
217
  >
217
218
  {{
218
- formatTimezoneToLocal(
219
- presentation.date,
220
- "h:mm a",
221
- conference.timezone
222
- )
219
+ getPresentationStartTime(presentation, "h:mm a")
223
220
  }}
224
221
 
225
222
  <span v-if="showPresentationEndTimes()"
226
- >- {{ getPresentationEndTime(presentation) }}</span
223
+ >- {{ getPresentationEndTime(presentation, "h:mm a") }}</span
227
224
  >
228
225
  {{
229
- formatTimezoneToLocal(
226
+ DateTime.fromSQL(
230
227
  presentation.date,
231
- "z",
232
- conference.timezone
233
- )
228
+ { zone: conference.timezone }
229
+ ).toLocal().offsetNameShort
234
230
  }}
235
231
  </h4>
236
232
 
@@ -1,9 +1,8 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref, toRefs, computed } from "vue";
3
3
  import { storeToRefs } from "pinia";
4
- import { get } from "lodash-es";
5
- import { DateTime } from "luxon";
6
4
  import { useTemplateConfigsStore } from "../../../store";
5
+ import { usePresentation } from "../../../composables/usePresentation";
7
6
  import "add-to-calendar-button";
8
7
  import { Conference } from "../../../models/conference";
9
8
  import { Presentation } from "../../../models/conference";
@@ -14,6 +13,11 @@ type Props = {
14
13
  const props = defineProps<Props>();
15
14
  const { conference, presentation } = toRefs(props);
16
15
  const { pagesConfigValue } = storeToRefs(useTemplateConfigsStore());
16
+ const {
17
+ getPresentationStartTime,
18
+ getPresentationEndTime
19
+ } = usePresentation(conference);
20
+
17
21
  // Computed
18
22
  const showAddToGoogleCalendar = computed((): boolean => {
19
23
  return pagesConfigValue.value("agenda.add_to_google_calendar", false);
@@ -22,24 +26,6 @@ const showAddToGoogleCalendar = computed((): boolean => {
22
26
  const showAddToMicrosoftCalendar = computed((): boolean => {
23
27
  return pagesConfigValue.value("agenda.add_to_microsoft_calendar", false);
24
28
  });
25
- const presStartDate = computed((): string => {
26
- return DateTime.fromSQL(presentation.value.date, {
27
- zone: conference.timezone,
28
- }).toFormat("yyyy-MM-dd");
29
- });
30
- const presStartTime = computed((): string => {
31
- return DateTime.fromSQL(presentation.value.date, {
32
- zone: conference.timezone,
33
- }).toFormat("HH:mm");
34
- });
35
- const presEndTime = computed((): string => {
36
- let duration: number = get(presentation.value, "duration", 3600); // default to 60 min
37
- return DateTime.fromSQL(presentation.value.date, {
38
- zone: conference.timezone,
39
- })
40
- .plus(duration * 1000)
41
- .toFormat("HH:mm");
42
- });
43
29
  const calendarOptions = computed((): string => {
44
30
  let opts = [];
45
31
  if (showAddToGoogleCalendar) {
@@ -62,9 +48,9 @@ const cssPath = computed((): string => {
62
48
  <add-to-calendar-button
63
49
  :name="presentation.name"
64
50
  :description="presentation.description"
65
- :startDate="presStartDate"
66
- :startTime="presStartTime"
67
- :endTime="presEndTime"
51
+ :startDate="getPresentationStartTime(presentation,'yyyy-MM-dd',false)"
52
+ :startTime="getPresentationStartTime(presentation,'HH:mm',false)"
53
+ :endTime="getPresentationEndTime(presentation,'HH:mm',false)"
68
54
  :timeZone="conference.timezone"
69
55
  :location="conference.location"
70
56
  listStyle="dropdown"
@@ -1,16 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref, toRefs, computed, onMounted } from "vue";
3
3
  import { storeToRefs } from "pinia";
4
- import {
5
- isBefore,
6
- differenceInDays,
7
- differenceInHours,
8
- differenceInMinutes,
9
- differenceInSeconds,
10
- addDays,
11
- addHours,
12
- addMinutes,
13
- } from "date-fns";
4
+ import { DateTime } from "luxon";
14
5
  import { useTemplateConfigsStore } from "../../store";
15
6
  import { countdownTimerClassObj } from "../../@types/components";
16
7
  import { useClassBinding } from "../../composables/useClassBinding";
@@ -91,34 +82,19 @@ const fontClass = computed(() => {
91
82
 
92
83
  // methods
93
84
  const updateCountdown = () => {
94
- if (!isBefore(new Date(), new Date(props.date))) {
85
+ if (DateTime.fromSQL(props.date).diffNow().milliseconds < 0) {
95
86
  isCounting.value = false;
96
87
  emit("complete");
97
88
  clearInterval(loopTimer.value);
98
89
  return;
99
90
  }
100
91
 
101
- days.value = differenceInDays(new Date(props.date), new Date());
102
- hours.value = differenceInHours(
103
- new Date(props.date),
104
- addDays(new Date(), days.value)
105
- );
92
+ let diffObj = DateTime.fromSQL(props.date).diffNow(['days', 'hours', 'minutes', 'seconds', 'milliseconds']);
106
93
 
107
- minutes.value = differenceInHours(
108
- new Date(props.date),
109
- addDays(addHours(new Date(), hours.value), days.value)
110
- );
111
- minutes.value = differenceInMinutes(
112
- new Date(props.date),
113
- addDays(addHours(new Date(), hours.value), days.value)
114
- );
115
- seconds.value = differenceInSeconds(
116
- new Date(props.date),
117
- addDays(
118
- addHours(addMinutes(new Date(), minutes.value), hours.value),
119
- days.value
120
- )
121
- );
94
+ days.value = diffObj.days;
95
+ hours.value = diffObj.hours;
96
+ minutes.value = diffObj.minutes;
97
+ seconds.value = diffObj.seconds;
122
98
  };
123
99
 
124
100
  const startCountdown = () => {
@@ -132,6 +108,9 @@ const startCountdown = () => {
132
108
  onMounted(() => {
133
109
  startCountdown();
134
110
  });
111
+ onUnmounted(() => {
112
+ clearInterval(loopTimer.value);
113
+ });
135
114
  </script>
136
115
 
137
116
  <template>
@@ -2,9 +2,9 @@
2
2
  import { ref, toRefs, computed } from "vue";
3
3
  import { storeToRefs } from "pinia";
4
4
  import { get } from "lodash-es";
5
+ import { useRuntimeConfig } from "#app";
5
6
  import { useConferencesStore } from "../../store/conferences";
6
7
  import { useTemplateConfigsStore } from "../../store/templateConfigs";
7
- import { useDateFormat } from "../../composables/useDateFormat";
8
8
  import { useConferenceHelpers } from "../../composables/useConferenceHelpers";
9
9
  import { useEvents } from "../../composables/useEvents";
10
10
  import { useClassBinding } from "../../composables/useClassBinding";
@@ -89,15 +89,14 @@ const { pastEvents, upcomingEvents } = storeToRefs(useConferencesStore());
89
89
  const { globalConfigValue, pagesConfigValue } = storeToRefs(
90
90
  useTemplateConfigsStore()
91
91
  );
92
- const { formatDate } = useDateFormat();
93
92
  const {
94
- isSingleDayEvent,
95
93
  showConferenceViewButton,
96
94
  getConferenceWebcastUrl,
97
95
  getConferenceWebcastButtonText,
98
96
  showViewArchiveButton,
99
97
  getViewArchiveUrl,
100
98
  getViewArchiveButtonText,
99
+ getConferenceDisplayDate,
101
100
  getConferenceRegUrl,
102
101
  getConferenceRegText,
103
102
  showConferenceRegButton,
@@ -282,10 +281,7 @@ const showLoginButton = computed((): boolean => {
282
281
  )
283
282
  "
284
283
  >
285
- {{ formatDate(conference.start_date) }}
286
- <span v-if="!isSingleDayEvent(conference)">
287
- - {{ formatDate(conference.end_date) }}</span
288
- >
284
+ {{ getConferenceDisplayDate(conference,true,false,false,true) }}
289
285
  </p>
290
286
  </div>
291
287
  <!-- countdown timer - top-aligned -->
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
- import { toRefs, computed, watch, onMounted, nextTick } from "vue";
2
+ import { ref, toRefs, computed, watch, onMounted, nextTick } from "vue";
3
3
  import { get } from "lodash-es";
4
- import { getUnixTime } from "date-fns";
4
+ import { DateTime } from "luxon";
5
5
  import { Presentation, Stream, PlayerObj } from "../../models/conference";
6
6
  import { WebcastPlayerClassObj } from "../../@types/components";
7
7
  import { useScripts } from "../../composables/useScripts";
@@ -35,7 +35,7 @@ let icvPlayerObj: PlayerObj = {
35
35
  playerDiv: "mediaPlayer",
36
36
  loadCustomStream: () => {},
37
37
  };
38
- let timeInterval: NodeJS.Timer | null = null;
38
+ const timeInterval = ref<NodeJS.Timer | null>(null);
39
39
 
40
40
  // emits
41
41
  const emit = defineEmits<{
@@ -79,7 +79,7 @@ const playStream = () => {
79
79
  };
80
80
 
81
81
  const checkStreamTime = () => {
82
- const defaultStreamUt = getUnixTime(Date.now()) - 40;
82
+ const defaultStreamUt = DateTime.now().toUnixInteger() - 40;
83
83
  const maxStreamDelay = defaultStreamUt - 20;
84
84
  let streamUt = get(icvPlayerObj, "stream_ut", defaultStreamUt);
85
85
 
@@ -93,7 +93,7 @@ const cleanup = () => {
93
93
  if (icvPlayerObj) {
94
94
  icvPlayerObj = <PlayerObj>{};
95
95
  }
96
- clearInterval(timeInterval);
96
+ clearInterval(timeInterval.value);
97
97
  };
98
98
 
99
99
  // watchers
@@ -125,10 +125,15 @@ onMounted(() => {
125
125
  _script.onload = () => {
126
126
  if (get(window, "ICVDMStreamPlayer", false)) {
127
127
  setupMediaPlayer();
128
- timeInterval = setInterval(checkStreamTime, 1000);
128
+ timeInterval.value = setInterval(() => {
129
+ checkStreamTime();
130
+ }, 1000);
129
131
  }
130
132
  };
131
133
  });
134
+ onUnmounted(() => {
135
+ cleanup();
136
+ });
132
137
  </script>
133
138
 
134
139
  <template>
@@ -3,7 +3,6 @@ export * from "./useAnalytics";
3
3
  export * from "./useApi";
4
4
  export * from "./useAuth";
5
5
  export * from "./useConferenceHelpers";
6
- export * from "./useDateFormat";
7
6
  export * from "./useLogin";
8
7
  export * from "./usePresentation";
9
8
  export * from "./usePresenter";
@@ -3,7 +3,6 @@ export * from "./useAnalytics.mjs";
3
3
  export * from "./useApi.mjs";
4
4
  export * from "./useAuth.mjs";
5
5
  export * from "./useConferenceHelpers.mjs";
6
- export * from "./useDateFormat.mjs";
7
6
  export * from "./useLogin.mjs";
8
7
  export * from "./usePresentation.mjs";
9
8
  export * from "./usePresenter.mjs";
@@ -1,7 +1,7 @@
1
1
  import { get, remove, cloneDeep, intersectionBy, pullAllBy } from "lodash-es";
2
2
  import { ref, computed, onBeforeMount } from "vue";
3
3
  import { storeToRefs } from "pinia";
4
- import { differenceInSeconds } from "date-fns";
4
+ import { DateTime } from "luxon";
5
5
  import { useTemplateConfigsStore } from "../store/index.mjs";
6
6
  import { useAuthStore } from "../store/auth.mjs";
7
7
  import { useAffiliatesStore } from "../store/affiliates.mjs";
@@ -44,10 +44,7 @@ export const useAgenda = (conference) => {
44
44
  }
45
45
  if (displayTrackGroups === "None") {
46
46
  tracks.sort((trackA, trackB) => {
47
- return differenceInSeconds(
48
- new Date(trackA.date),
49
- new Date(trackB.date)
50
- );
47
+ return DateTime.fromSQL(trackA.date).diff(DateTime.fromSQL(trackB.date)).milliseconds;
51
48
  });
52
49
  return tracks;
53
50
  }
@@ -59,10 +56,7 @@ export const useAgenda = (conference) => {
59
56
  remove(trackGroup.tracks, ["access", false]);
60
57
  }
61
58
  trackGroup.tracks.sort((trackA, trackB) => {
62
- return differenceInSeconds(
63
- new Date(trackA.date),
64
- new Date(trackB.date)
65
- );
59
+ return DateTime.fromSQL(trackA.date).diff(DateTime.fromSQL(trackB.date)).milliseconds;
66
60
  });
67
61
  trackGroup.type = "track_group";
68
62
  });
@@ -71,7 +65,7 @@ export const useAgenda = (conference) => {
71
65
  });
72
66
  const combinedArray = trackGroups.concat(tracks);
73
67
  combinedArray.sort((trackA, trackB) => {
74
- return differenceInSeconds(new Date(trackA.date), new Date(trackB.date));
68
+ return DateTime.fromSQL(trackA.date).diff(DateTime.fromSQL(trackB.date)).milliseconds;
75
69
  });
76
70
  return combinedArray;
77
71
  };
@@ -3,13 +3,13 @@ import { DateTime } from "luxon";
3
3
  import { get, find } from "lodash-es";
4
4
  import { storeToRefs } from "pinia";
5
5
  import { useRoute } from "vue-router";
6
+ import { useRuntimeConfig } from "#app";
6
7
  import { ConferenceState } from "../models/conference.mjs";
7
8
  import {
8
9
  useTemplateConfigsStore,
9
10
  useConferencesStore,
10
11
  useAuthStore
11
12
  } from "../store";
12
- import { useDateFormat } from "./useDateFormat.mjs";
13
13
  const config = useRuntimeConfig();
14
14
  const getConferenceConfigMainValue = (_conference, _name) => {
15
15
  const configPages = get(_conference, "template_config.config.pages", []);
@@ -25,7 +25,6 @@ export const useConferenceHelpers = (conference) => {
25
25
  const { pagesConfigValue, globalConfigValue } = toRefs(
26
26
  useTemplateConfigsStore()
27
27
  );
28
- const { formatTimezoneToLocal } = useDateFormat();
29
28
  const route = useRoute();
30
29
  const { user, isLoggedIn } = storeToRefs(useAuthStore());
31
30
  const { currentConference } = storeToRefs(useConferencesStore());
@@ -98,7 +97,7 @@ export const useConferenceHelpers = (conference) => {
98
97
  const startDate = _selectedConference.start_date;
99
98
  const endDate = _selectedConference.end_date;
100
99
  let returnDate = "";
101
- if (isSingleDayEvent()) {
100
+ if (isSingleDayEvent(_conference)) {
102
101
  const startFormat = "MMMM d, yyyy ";
103
102
  if (showDate) {
104
103
  returnDate += DateTime.fromSQL(
@@ -136,7 +135,6 @@ export const useConferenceHelpers = (conference) => {
136
135
  endDate,
137
136
  { zone: _selectedConference.timezone }
138
137
  ).toLocal().toFormat(endFormat);
139
- returnDate += " " + getTimezoneDisplay(endDate, _selectedConference.timezone, showTwoCharTz);
140
138
  }
141
139
  return returnDate;
142
140
  };
@@ -2,6 +2,7 @@ import { ref, computed } from "vue";
2
2
  import { storeToRefs } from "pinia";
3
3
  import { useRouter, useRoute } from "vue-router";
4
4
  import { get, sortBy, filter } from "lodash-es";
5
+ import { useRuntimeConfig } from "#app";
5
6
  import { useAuthStore, useTemplateConfigsStore } from "../store/index.mjs";
6
7
  export const useEvents = () => {
7
8
  const route = useRoute();
@@ -9,10 +9,14 @@ export type UsePresentationMethods = {
9
9
  * show presentation end times
10
10
  */
11
11
  showPresentationEndTimes: () => boolean;
12
+ /**
13
+ * get presentation start time
14
+ */
15
+ getPresentationStartTime: (presentation: Presentation, format?: string, convertToLocal?: boolean) => string;
12
16
  /**
13
17
  * get presentation end time
14
18
  */
15
- getPresentationEndTime: (presentation: Presentation) => string;
19
+ getPresentationEndTime: (presentation: Presentation, format?: string, convertToLocal?: boolean) => string;
16
20
  /**
17
21
  * get presentation link target
18
22
  */
@@ -1,12 +1,11 @@
1
- import { addSeconds, format, parseISO } from "date-fns";
1
+ import { get } from "lodash-es";
2
+ import { DateTime } from "luxon";
2
3
  import { useTemplateConfigsStore } from "../store/index.mjs";
3
4
  import {
4
5
  ConferenceState
5
6
  } from "../models/conference";
6
- import { useDateFormat } from "./useDateFormat.mjs";
7
7
  import { useConferenceHelpers } from "./useConferenceHelpers.mjs";
8
8
  export const usePresentation = (conference) => {
9
- const { formatTimezoneToLocal } = useDateFormat();
10
9
  const { pagesConfigValue } = useTemplateConfigsStore();
11
10
  const { conferenceIsMixed, getConferenceRegUrl } = useConferenceHelpers(conference);
12
11
  const showPresentationTimes = (presentation) => {
@@ -15,17 +14,18 @@ export const usePresentation = (conference) => {
15
14
  const showPresentationEndTimes = () => {
16
15
  return pagesConfigValue("agenda.session_end_times", false);
17
16
  };
18
- const getPresentationEndTime = (presentation) => {
19
- const presentationDuration = presentation.duration ? presentation.duration : 0;
20
- const presentationEndTime = format(
21
- addSeconds(parseISO(presentation.date), presentationDuration),
22
- "yyyy-MM-dd HH:mm"
23
- );
24
- return formatTimezoneToLocal(
25
- presentationEndTime,
26
- "h:mm a",
27
- conference.value.timezone
28
- );
17
+ const getPresentationStartTime = (presentation, format = "h:mm a", convertToLocal = true) => {
18
+ let dt = DateTime.fromSQL(presentation.date, {
19
+ zone: conference.value.timezone
20
+ });
21
+ return convertToLocal ? dt.toLocal().toFormat(format) : dt.toFormat(format);
22
+ };
23
+ const getPresentationEndTime = (presentation, format = "h:mm a", convertToLocal = true) => {
24
+ let duration = get(presentation, "duration", 0);
25
+ let dt = DateTime.fromSQL(presentation.date, {
26
+ zone: conference.value.timezone
27
+ }).plus(duration * 1e3);
28
+ return convertToLocal ? dt.toLocal().toFormat(format) : dt.toFormat(format);
29
29
  };
30
30
  const getPresentationLinkTarget = (presentation) => {
31
31
  return presentation.type === "link" ? "_blank" : "";
@@ -90,6 +90,7 @@ export const usePresentation = (conference) => {
90
90
  return {
91
91
  showPresentationTimes,
92
92
  showPresentationEndTimes,
93
+ getPresentationStartTime,
93
94
  getPresentationEndTime,
94
95
  getPresentationLinkTarget,
95
96
  getArchivePresentationLinkDestination,
@@ -9,7 +9,6 @@ export const useAuthStore = defineStore("auth", {
9
9
  }),
10
10
  getters: {
11
11
  isLoggedIn: (state) => {
12
- console.log("isLoggedIn method state", state);
13
12
  return state.user !== null;
14
13
  }
15
14
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.120",
3
+ "version": "0.0.122",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -28,8 +28,6 @@
28
28
  "@pinia/nuxt": "^0.3.1",
29
29
  "add-to-calendar-button": "^2.1.1",
30
30
  "analytics": "^0.8.1",
31
- "date-fns": "^2.29.1",
32
- "date-fns-tz": "^1.3.6",
33
31
  "lodash-es": "^4.17.21",
34
32
  "luxon": "^3.2.1",
35
33
  "nprogress": "^0.2.0",
@@ -1,12 +0,0 @@
1
- export type DateFunctions = {
2
- /**
3
- * Takes a date string and converts it to a formatted date
4
- * e.g August 8, 2022
5
- */
6
- formatDate: (date: string, dateFormat?: string) => string;
7
- /**
8
- * Takes a date string with its timezone and converts it to the users local time.
9
- */
10
- formatTimezoneToLocal: (date: string | Date, dateFormat: string, timezone: string) => string;
11
- };
12
- export declare const useDateFormat: () => DateFunctions;
@@ -1,17 +0,0 @@
1
- import { format as formatTz } from "date-fns-tz";
2
- import { format, parseISO } from "date-fns";
3
- export const useDateFormat = () => {
4
- const formatDate = (date, dateFormat = "MMMM d, Y") => {
5
- return format(new Date(parseISO(date)), dateFormat);
6
- };
7
- const formatTimezoneToLocal = (date, dateFormat, timezone) => {
8
- const tempDate = typeof date === "string" ? parseISO(date) : date;
9
- return formatTz(tempDate, dateFormat, {
10
- timeZone: timezone
11
- });
12
- };
13
- return {
14
- formatTimezoneToLocal,
15
- formatDate
16
- };
17
- };