@icvdeveloper/common-module 0.1.3 → 1.0.0

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/CHANGELOG.md CHANGED
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 1.0.0 - 2023-05-24
11
+
10
12
  ## 0.1.3 - 2023-05-18
11
13
 
12
14
  ## 0.1.2 - 2023-05-17
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "v3plus-common-module",
3
3
  "configKey": "v3plusCommonModule",
4
- "version": "0.1.3"
4
+ "version": "1.0.0"
5
5
  }
@@ -8,6 +8,7 @@ import { useClassBinding } from "../../composables/useClassBinding";
8
8
 
9
9
  interface Props {
10
10
  date: string;
11
+ timezone: string;
11
12
  isCompact?: boolean;
12
13
  showDays?: boolean;
13
14
  showHours?: boolean;
@@ -49,6 +50,10 @@ const {
49
50
 
50
51
  const { classBinding } = useClassBinding();
51
52
 
53
+ const eventDate: DateTime = DateTime.fromSQL(props.date, {
54
+ zone: props.timezone,
55
+ });
56
+
52
57
  // reactive data
53
58
  const isCounting = ref<boolean>(true);
54
59
  const days = ref<number>(0);
@@ -82,14 +87,19 @@ const fontClass = computed(() => {
82
87
 
83
88
  // methods
84
89
  const updateCountdown = () => {
85
- if (DateTime.fromSQL(props.date).diffNow().milliseconds < 0) {
90
+ if (
91
+ DateTime.fromSQL(props.date, { zone: props.timezone }).toLocal().diffNow()
92
+ .milliseconds < 0
93
+ ) {
86
94
  isCounting.value = false;
87
95
  emit("complete");
88
96
  clearInterval(loopTimer.value);
89
97
  return;
90
98
  }
91
99
 
92
- let diffObj = DateTime.fromSQL(props.date).diffNow(['days', 'hours', 'minutes', 'seconds', 'milliseconds']);
100
+ const diffObj = DateTime.fromSQL(props.date, { zone: props.timezone })
101
+ .toLocal()
102
+ .diffNow(["days", "hours", "minutes", "seconds", "milliseconds"]);
93
103
 
94
104
  days.value = diffObj.days;
95
105
  hours.value = diffObj.hours;
@@ -139,7 +149,7 @@ onUnmounted(() => {
139
149
  )
140
150
  "
141
151
  >
142
- {{ !isCounting ? "event begins" : eventHasBegunText }}
152
+ {{ isCounting ? "event begins" : eventHasBegunText }}
143
153
  </h1>
144
154
  </div>
145
155
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.1.3",
3
+ "version": "1.0.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {