@kiva/kv-components 3.46.2 → 3.46.3

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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.46.3](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.46.2...@kiva/kv-components@3.46.3) (2023-10-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * kvcountdowtimer component updated to show the remaining hours correctly ([#307](https://github.com/kiva/kv-ui-elements/issues/307)) ([1ea593c](https://github.com/kiva/kv-ui-elements/commit/1ea593ce88339fff9e9bf2bcd1e33bed46a8b09a))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.46.2](https://github.com/kiva/kv-ui-elements/compare/@kiva/kv-components@3.46.1...@kiva/kv-components@3.46.2) (2023-10-12)
7
18
 
8
19
  **Note:** Version bump only for package @kiva/kv-components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiva/kv-components",
3
- "version": "3.46.2",
3
+ "version": "3.46.3",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -75,5 +75,5 @@
75
75
  "optional": true
76
76
  }
77
77
  },
78
- "gitHead": "4b787763e203554045ea484e99a4ecb875875442"
78
+ "gitHead": "6fc84d328af54b57e6f9b9b1c409ce4a695d2b10"
79
79
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <span v-if="timeLeft">
3
- {{ timeLeft.hours() }}h {{ timeLeft.minutes() }}m {{ timeLeft.seconds() }}s
3
+ {{ remainingHours }}h {{ timeLeft.minutes() }}m {{ timeLeft.seconds() }}s
4
4
  </span>
5
5
  </template>
6
6
 
@@ -10,6 +10,7 @@ import {
10
10
  toRefs,
11
11
  onBeforeUnmount,
12
12
  onMounted,
13
+ computed,
13
14
  } from 'vue-demi';
14
15
  import moment from 'moment';
15
16
 
@@ -26,6 +27,10 @@ export default {
26
27
  const interval = ref(null);
27
28
  const timeLeft = ref(null);
28
29
 
30
+ const remainingHours = computed(() => {
31
+ return Math.floor(timeLeft.value.asHours());
32
+ });
33
+
29
34
  onMounted(() => {
30
35
  timeLeft.value = moment.duration(msLeft.value > 0 ? msLeft.value : 0, 'milliseconds');
31
36
 
@@ -48,7 +53,7 @@ export default {
48
53
  }
49
54
  });
50
55
 
51
- return { timeLeft };
56
+ return { timeLeft, remainingHours };
52
57
  },
53
58
  };
54
59
  </script>
@@ -23,7 +23,8 @@ const story = (args) => {
23
23
 
24
24
  export const Seconds = story({ msLeft: 1000 * 10 });
25
25
 
26
- // One second less than 24 hours (since we don't show days in timer)
27
- export const Tomorrow = story({ msLeft: 1000 * 60 * 60 * 24 - 1000 });
26
+ export const Tomorrow = story({ msLeft: 1000 * 60 * 60 * 24 });
28
27
 
29
28
  export const Expired = story({ msLeft: 0 });
29
+
30
+ export const Overmorrow = story({ msLeft: 1000 * 60 * 60 * 48 });