@icvdeveloper/common-module 0.0.110 → 0.0.112

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.110"
4
+ "version": "0.0.112"
5
5
  }
@@ -21,10 +21,14 @@ export type UseConferenceHelpersMethods = {
21
21
  * Get conference webcast url
22
22
  */
23
23
  getConferenceWebcastUrl: (_conference?: Conference, _eventPath?: string) => string;
24
+ /**
25
+ * Get timezone display
26
+ */
27
+ getTimezoneDisplay: (sqlDate: string, timezone: string, showTwoCharTz: boolean) => string;
24
28
  /**
25
29
  * Get conference display date.
26
30
  */
27
- getConferenceDisplayDate: (_conference: Conference, showDate: boolean, showTime: boolean, showEndTime: boolean) => string;
31
+ getConferenceDisplayDate: (_conference: Conference, showDate: boolean, showTime: boolean, showEndTime: boolean, showTwoCharTz: boolean) => string;
28
32
  /**
29
33
  * Determine if show view archive button should be shown
30
34
  */
@@ -1,5 +1,5 @@
1
1
  import { toRefs } from "vue";
2
- import { format, parseISO } from "date-fns";
2
+ 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";
@@ -74,60 +74,67 @@ export const useConferenceHelpers = (conference) => {
74
74
  const viewNowAliasText = globalConfigValue.value("view_now_button_alias");
75
75
  return viewNowAliasText || "View Now";
76
76
  };
77
- const getConferenceDisplayDate = (_conference, showDate = true, showTime = false, showEndTime = false) => {
77
+ const getTimezoneDisplay = (sqlDate, timezone, showTwoCharTz) => {
78
+ let tz = "";
79
+ if (pagesConfigValue.value("main.use_event_text_tz")) {
80
+ let threeCharTz = DateTime.fromSQL(
81
+ sqlDate,
82
+ { zone: timezone }
83
+ ).toLocal().toFormat("ZZZZ");
84
+ tz = threeCharTz;
85
+ if (showTwoCharTz) {
86
+ if (threeCharTz.length >= 3 && threeCharTz.length <= 4 && (threeCharTz.charAt(threeCharTz.length - 2) == "S" || threeCharTz.charAt(threeCharTz.length - 2) == "D")) {
87
+ let twoCharTz = threeCharTz.substring(0, threeCharTz.length - 2) + threeCharTz.charAt(threeCharTz.length - 1);
88
+ tz = twoCharTz;
89
+ }
90
+ }
91
+ }
92
+ return tz;
93
+ };
94
+ const getConferenceDisplayDate = (_conference, showDate = true, showTime = false, showEndTime = false, showTwoCharTz = false) => {
78
95
  const _selectedConference = _getSelectedConference(_conference);
79
96
  const startDate = _selectedConference.start_date;
80
97
  const endDate = _selectedConference.end_date;
81
98
  let returnDate = "";
82
- const tzFormat = pagesConfigValue.value("main.use_event_text_tz") ? " zzz" : "";
83
99
  if (isSingleDayEvent()) {
84
100
  const startFormat = "MMMM d, yyyy ";
85
101
  if (showDate) {
86
- returnDate += formatTimezoneToLocal(
102
+ returnDate += DateTime.fromSQL(
87
103
  startDate,
88
- startFormat,
89
- _selectedConference.timezone
90
- );
104
+ { zone: _selectedConference.timezone }
105
+ ).toLocal().toFormat(startFormat);
91
106
  }
92
107
  if (showTime) {
93
- returnDate += formatTimezoneToLocal(
108
+ returnDate += DateTime.fromSQL(
94
109
  startDate,
95
- "h:mm a",
96
- _selectedConference.timezone
97
- );
110
+ { zone: _selectedConference.timezone }
111
+ ).toLocal().toFormat("h:mm a");
98
112
  if (showEndTime) {
99
- returnDate += " - " + formatTimezoneToLocal(
113
+ returnDate += " - " + DateTime.fromSQL(
100
114
  endDate,
101
- "h:mm a",
102
- _selectedConference.timezone
103
- );
115
+ { zone: _selectedConference.timezone }
116
+ ).toLocal().toFormat("h:mm a");
104
117
  }
105
- returnDate += formatTimezoneToLocal(
106
- startDate,
107
- tzFormat,
108
- _selectedConference.timezone
109
- );
118
+ returnDate += " " + getTimezoneDisplay(startDate, _selectedConference.timezone, showTwoCharTz);
110
119
  }
111
120
  } else if (showDate) {
112
- let startFormat = "MMMM do";
113
- if (format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
121
+ let startFormat = "MMMM d";
122
+ if (DateTime.fromSQL(startDate).toFormat("yyyy") !== DateTime.fromSQL(endDate).toFormat("yyyy")) {
114
123
  startFormat += ", yyyy";
115
124
  }
116
- returnDate += formatTimezoneToLocal(
125
+ returnDate += DateTime.fromSQL(
117
126
  startDate,
118
- startFormat,
119
- _selectedConference.timezone
120
- );
121
- returnDate += " - ";
122
- let endFormat = "d, yyyy" + tzFormat;
123
- if (format(parseISO(startDate), "MMMM") !== format(parseISO(endDate), "MMMM") || format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
127
+ { zone: _selectedConference.timezone }
128
+ ).toLocal().toFormat(startFormat);
129
+ let endFormat = "d, yyyy";
130
+ if (DateTime.fromSQL(startDate).toFormat("MMMM") !== DateTime.fromSQL(endDate).toFormat("MMMM") || DateTime.fromSQL(startDate).toFormat("yyyy") !== DateTime.fromSQL(endDate).toFormat("yyyy")) {
124
131
  endFormat = "MMMM " + endFormat;
125
132
  }
126
- returnDate += formatTimezoneToLocal(
133
+ returnDate += " - " + DateTime.fromSQL(
127
134
  endDate,
128
- endFormat,
129
- _selectedConference.timezone
130
- );
135
+ { zone: _selectedConference.timezone }
136
+ ).toLocal().toFormat(endFormat);
137
+ returnDate += " " + getTimezoneDisplay(endDate, _selectedConference.timezone, showTwoCharTz);
131
138
  }
132
139
  return returnDate;
133
140
  };
@@ -254,6 +261,7 @@ export const useConferenceHelpers = (conference) => {
254
261
  showConferenceWebcastButton,
255
262
  getConferenceWebcastButtonText,
256
263
  getConferenceWebcastUrl,
264
+ getTimezoneDisplay,
257
265
  getConferenceDisplayDate,
258
266
  showViewArchiveButton,
259
267
  getViewArchiveUrl,
@@ -1,11 +1,13 @@
1
1
  import { defineNuxtPlugin } from "#app";
2
2
  import { computed } from "vue";
3
3
  import { storeToRefs } from "pinia";
4
+ import { find } from "lodash-es";
4
5
  import NProgress from "nprogress";
5
6
  import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
6
7
  import { createV3plusCommonPlugin } from "./v3plusCommonPlugin.mjs";
7
8
  import { usePortalStore } from "./store/portal.mjs";
8
9
  import { useTemplateConfigsStore } from "./store/templateConfigs.mjs";
10
+ import { useNavigationConfigStore } from "./store/navigationConfig.mjs";
9
11
  import { useConferencesStore } from "./store/conferences.mjs";
10
12
  import { usePresentationsStore } from "./store/presentations.mjs";
11
13
  export default defineNuxtPlugin((nuxtApp) => {
@@ -27,6 +29,9 @@ export default defineNuxtPlugin((nuxtApp) => {
27
29
  const { selectedConference } = storeToRefs(
28
30
  useConferencesStore()
29
31
  );
32
+ const { data: navigation } = storeToRefs(
33
+ useNavigationConfigStore()
34
+ );
30
35
  let docTitle = "Rubicon";
31
36
  let docSubtitle = "";
32
37
  let routeArray = to.name.toLowerCase().split("-");
@@ -68,34 +73,42 @@ export default defineNuxtPlugin((nuxtApp) => {
68
73
  presentationsStore.selectedPresentation = null;
69
74
  }
70
75
  if (!docSubtitle && to.name != "index") {
71
- let routeName = routeArray.map(
72
- function(word) {
73
- return word.charAt(0).toUpperCase() + word.slice(1);
74
- }
75
- ).join(" ");
76
- docSubtitle += `${routeName}`;
76
+ let navObj = find(navigation.value, { "url": to.path });
77
+ if (navObj) {
78
+ docSubtitle += `${navObj.label}`;
79
+ } else {
80
+ let routeName = routeArray.map(
81
+ function(word) {
82
+ return word.charAt(0).toUpperCase() + word.slice(1);
83
+ }
84
+ ).join(" ");
85
+ docSubtitle += `${routeName}`;
86
+ }
77
87
  }
78
88
  if (docSubtitle)
79
- docTitle += ` - ${docSubtitle}`;
89
+ docTitle += ` | ${docSubtitle}`;
80
90
  document.title = docTitle;
81
91
  });
82
92
  nuxtApp.$router.afterEach(() => {
83
93
  NProgress.done();
84
94
  });
85
95
  nuxtApp.hook("app:created", (app) => {
86
- const { data } = storeToRefs(usePortalStore());
96
+ const { data: portal } = storeToRefs(usePortalStore());
87
97
  const { globalConfigValue } = useTemplateConfigsStore();
88
98
  let customCss = globalConfigValue("custom_css");
89
99
  customCss = customCss.length > 0 ? customCss.replace(/\n/g, "") : "";
90
- if (data.value) {
100
+ if (portal.value) {
91
101
  app.config.globalProperties.$head.addHeadObjs(
92
102
  computed(() => {
93
103
  return {
104
+ meta: [
105
+ { name: "description", content: portal.value.description }
106
+ ],
94
107
  link: [
95
108
  {
96
109
  rel: "icon",
97
110
  type: "image/x-icon",
98
- href: data.value.favicon
111
+ href: portal.value.favicon
99
112
  }
100
113
  ],
101
114
  style: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.110",
3
+ "version": "0.0.112",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {