@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260902111021 → 0.8.1-dev.20260902122246
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/{TimeUntilStartsClient-4C7NDEAD.mjs → TimeUntilStartsClient-P4VJIOJJ.mjs} +22 -7
- package/dist/{TimeUntilStartsClient-5HGQ5JKM.mjs → TimeUntilStartsClient-ZKTMV247.mjs} +22 -7
- package/dist/index.js +22 -7
- package/dist/index.mjs +1 -1
- package/dist/server.js +22 -7
- package/dist/server.mjs +1 -1
- package/package.json +1 -1
|
@@ -18,6 +18,11 @@ var TimeUntilStartsClient = (props) => {
|
|
|
18
18
|
const diffMinutes = Math.floor(
|
|
19
19
|
absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
|
|
20
20
|
);
|
|
21
|
+
if (!isPast && absoluteDiffMs < 1e3 * 60 * 60 * 24) {
|
|
22
|
+
const diffSeconds = Math.floor(absoluteDiffMs % (1e3 * 60) / 1e3);
|
|
23
|
+
const padTimePart = (value) => value.toString().padStart(2, "0");
|
|
24
|
+
return `Starting in ${padTimePart(diffHours)}:${padTimePart(diffMinutes)}:${padTimePart(diffSeconds)}`;
|
|
25
|
+
}
|
|
21
26
|
if (absoluteDiffMs < 6e4) {
|
|
22
27
|
return "Just now";
|
|
23
28
|
}
|
|
@@ -56,14 +61,24 @@ var TimeUntilStartsClient = (props) => {
|
|
|
56
61
|
});
|
|
57
62
|
useEffect(() => {
|
|
58
63
|
if (props.value && isValidDate(props.value)) {
|
|
64
|
+
const getRemainingMilliseconds = () => {
|
|
65
|
+
const now = /* @__PURE__ */ new Date();
|
|
66
|
+
const nowUtc = new Date(
|
|
67
|
+
now.getTime() + now.getTimezoneOffset() * 6e4
|
|
68
|
+
);
|
|
69
|
+
return new Date(props.value).getTime() - nowUtc.getTime();
|
|
70
|
+
};
|
|
71
|
+
const shouldRefreshOnExpiry = getRemainingMilliseconds() > 0;
|
|
59
72
|
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
const interval = setInterval(() => {
|
|
74
|
+
if (shouldRefreshOnExpiry && getRemainingMilliseconds() <= 0) {
|
|
75
|
+
clearInterval(interval);
|
|
76
|
+
window.location.reload();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
80
|
+
}, 1e3);
|
|
81
|
+
return () => clearInterval(interval);
|
|
67
82
|
} else {
|
|
68
83
|
setTimeUntilStart("");
|
|
69
84
|
}
|
|
@@ -20,6 +20,11 @@ var TimeUntilStartsClient = (props) => {
|
|
|
20
20
|
const diffMinutes = Math.floor(
|
|
21
21
|
absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
|
|
22
22
|
);
|
|
23
|
+
if (!isPast && absoluteDiffMs < 1e3 * 60 * 60 * 24) {
|
|
24
|
+
const diffSeconds = Math.floor(absoluteDiffMs % (1e3 * 60) / 1e3);
|
|
25
|
+
const padTimePart = (value) => value.toString().padStart(2, "0");
|
|
26
|
+
return `Starting in ${padTimePart(diffHours)}:${padTimePart(diffMinutes)}:${padTimePart(diffSeconds)}`;
|
|
27
|
+
}
|
|
23
28
|
if (absoluteDiffMs < 6e4) {
|
|
24
29
|
return "Just now";
|
|
25
30
|
}
|
|
@@ -58,14 +63,24 @@ var TimeUntilStartsClient = (props) => {
|
|
|
58
63
|
});
|
|
59
64
|
useEffect(() => {
|
|
60
65
|
if (props.value && isValidDate(props.value)) {
|
|
66
|
+
const getRemainingMilliseconds = () => {
|
|
67
|
+
const now = /* @__PURE__ */ new Date();
|
|
68
|
+
const nowUtc = new Date(
|
|
69
|
+
now.getTime() + now.getTimezoneOffset() * 6e4
|
|
70
|
+
);
|
|
71
|
+
return new Date(props.value).getTime() - nowUtc.getTime();
|
|
72
|
+
};
|
|
73
|
+
const shouldRefreshOnExpiry = getRemainingMilliseconds() > 0;
|
|
61
74
|
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
75
|
+
const interval = setInterval(() => {
|
|
76
|
+
if (shouldRefreshOnExpiry && getRemainingMilliseconds() <= 0) {
|
|
77
|
+
clearInterval(interval);
|
|
78
|
+
window.location.reload();
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
82
|
+
}, 1e3);
|
|
83
|
+
return () => clearInterval(interval);
|
|
69
84
|
} else {
|
|
70
85
|
setTimeUntilStart("");
|
|
71
86
|
}
|
package/dist/index.js
CHANGED
|
@@ -850,6 +850,11 @@ var init_TimeUntilStartsClient = __esm({
|
|
|
850
850
|
const diffMinutes = Math.floor(
|
|
851
851
|
absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
|
|
852
852
|
);
|
|
853
|
+
if (!isPast && absoluteDiffMs < 1e3 * 60 * 60 * 24) {
|
|
854
|
+
const diffSeconds = Math.floor(absoluteDiffMs % (1e3 * 60) / 1e3);
|
|
855
|
+
const padTimePart = (value) => value.toString().padStart(2, "0");
|
|
856
|
+
return `Starting in ${padTimePart(diffHours)}:${padTimePart(diffMinutes)}:${padTimePart(diffSeconds)}`;
|
|
857
|
+
}
|
|
853
858
|
if (absoluteDiffMs < 6e4) {
|
|
854
859
|
return "Just now";
|
|
855
860
|
}
|
|
@@ -888,14 +893,24 @@ var init_TimeUntilStartsClient = __esm({
|
|
|
888
893
|
});
|
|
889
894
|
(0, import_react16.useEffect)(() => {
|
|
890
895
|
if (props.value && isValidDate(props.value)) {
|
|
896
|
+
const getRemainingMilliseconds = () => {
|
|
897
|
+
const now = /* @__PURE__ */ new Date();
|
|
898
|
+
const nowUtc = new Date(
|
|
899
|
+
now.getTime() + now.getTimezoneOffset() * 6e4
|
|
900
|
+
);
|
|
901
|
+
return new Date(props.value).getTime() - nowUtc.getTime();
|
|
902
|
+
};
|
|
903
|
+
const shouldRefreshOnExpiry = getRemainingMilliseconds() > 0;
|
|
891
904
|
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
892
|
-
const
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
905
|
+
const interval = setInterval(() => {
|
|
906
|
+
if (shouldRefreshOnExpiry && getRemainingMilliseconds() <= 0) {
|
|
907
|
+
clearInterval(interval);
|
|
908
|
+
window.location.reload();
|
|
909
|
+
return;
|
|
910
|
+
}
|
|
911
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
912
|
+
}, 1e3);
|
|
913
|
+
return () => clearInterval(interval);
|
|
899
914
|
} else {
|
|
900
915
|
setTimeUntilStart("");
|
|
901
916
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -403,7 +403,7 @@ var DateTimeVew_default = DateTimeView;
|
|
|
403
403
|
|
|
404
404
|
// src/components/controls/view/TimeUntilStarts.tsx
|
|
405
405
|
import dynamic4 from "next/dynamic";
|
|
406
|
-
var TimeUntilStarts = dynamic4(() => import("./TimeUntilStartsClient-
|
|
406
|
+
var TimeUntilStarts = dynamic4(() => import("./TimeUntilStartsClient-ZKTMV247.mjs"), {
|
|
407
407
|
ssr: false
|
|
408
408
|
});
|
|
409
409
|
var TimeUntilStarts_default = TimeUntilStarts;
|
package/dist/server.js
CHANGED
|
@@ -1637,6 +1637,11 @@ var init_TimeUntilStartsClient = __esm({
|
|
|
1637
1637
|
const diffMinutes = Math.floor(
|
|
1638
1638
|
absoluteDiffMs % (1e3 * 60 * 60) / (1e3 * 60)
|
|
1639
1639
|
);
|
|
1640
|
+
if (!isPast && absoluteDiffMs < 1e3 * 60 * 60 * 24) {
|
|
1641
|
+
const diffSeconds = Math.floor(absoluteDiffMs % (1e3 * 60) / 1e3);
|
|
1642
|
+
const padTimePart = (value) => value.toString().padStart(2, "0");
|
|
1643
|
+
return `Starting in ${padTimePart(diffHours)}:${padTimePart(diffMinutes)}:${padTimePart(diffSeconds)}`;
|
|
1644
|
+
}
|
|
1640
1645
|
if (absoluteDiffMs < 6e4) {
|
|
1641
1646
|
return "Just now";
|
|
1642
1647
|
}
|
|
@@ -1675,14 +1680,24 @@ var init_TimeUntilStartsClient = __esm({
|
|
|
1675
1680
|
});
|
|
1676
1681
|
(0, import_react21.useEffect)(() => {
|
|
1677
1682
|
if (props.value && isValidDate(props.value)) {
|
|
1683
|
+
const getRemainingMilliseconds = () => {
|
|
1684
|
+
const now = /* @__PURE__ */ new Date();
|
|
1685
|
+
const nowUtc = new Date(
|
|
1686
|
+
now.getTime() + now.getTimezoneOffset() * 6e4
|
|
1687
|
+
);
|
|
1688
|
+
return new Date(props.value).getTime() - nowUtc.getTime();
|
|
1689
|
+
};
|
|
1690
|
+
const shouldRefreshOnExpiry = getRemainingMilliseconds() > 0;
|
|
1678
1691
|
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
1679
|
-
const
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1692
|
+
const interval = setInterval(() => {
|
|
1693
|
+
if (shouldRefreshOnExpiry && getRemainingMilliseconds() <= 0) {
|
|
1694
|
+
clearInterval(interval);
|
|
1695
|
+
window.location.reload();
|
|
1696
|
+
return;
|
|
1697
|
+
}
|
|
1698
|
+
setTimeUntilStart(calculateTimeDifference(props.value));
|
|
1699
|
+
}, 1e3);
|
|
1700
|
+
return () => clearInterval(interval);
|
|
1686
1701
|
} else {
|
|
1687
1702
|
setTimeUntilStart("");
|
|
1688
1703
|
}
|
package/dist/server.mjs
CHANGED
|
@@ -736,7 +736,7 @@ var DateTimeVew_default = DateTimeView;
|
|
|
736
736
|
|
|
737
737
|
// src/components/controls/view/TimeUntilStarts.tsx
|
|
738
738
|
import dynamic6 from "next/dynamic";
|
|
739
|
-
var TimeUntilStarts = dynamic6(() => import("./TimeUntilStartsClient-
|
|
739
|
+
var TimeUntilStarts = dynamic6(() => import("./TimeUntilStartsClient-P4VJIOJJ.mjs"), {
|
|
740
740
|
ssr: false
|
|
741
741
|
});
|
|
742
742
|
var TimeUntilStarts_default = TimeUntilStarts;
|