ag-common 0.0.600 → 0.0.602
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dateTimeToNearestMinute = exports.CSharpToJs = exports.dateDiff = exports.lastDayInMonth = exports.addMinutes = exports.addDays = exports.addHours = exports.getTimeSeconds = void 0;
|
|
3
|
+
exports.getUtcDateTime = exports.dateTimeToNearestMinute = exports.CSharpToJs = exports.dateDiff = exports.lastDayInMonth = exports.addMinutes = exports.addDays = exports.addHours = exports.getTimeSeconds = void 0;
|
|
4
4
|
const math_1 = require("./math");
|
|
5
5
|
const getTimeSeconds = () => Math.ceil(new Date().getTime() / 1000);
|
|
6
6
|
exports.getTimeSeconds = getTimeSeconds;
|
|
@@ -62,3 +62,15 @@ const dateTimeToNearestMinute = (minutes, date) => {
|
|
|
62
62
|
return rounded;
|
|
63
63
|
};
|
|
64
64
|
exports.dateTimeToNearestMinute = dateTimeToNearestMinute;
|
|
65
|
+
const getUtcDateTime = () => {
|
|
66
|
+
const date = new Date();
|
|
67
|
+
const year = date.getUTCFullYear();
|
|
68
|
+
const month = ('0' + (date.getUTCMonth() + 1)).slice(-2);
|
|
69
|
+
const day = ('0' + date.getUTCDate()).slice(-2);
|
|
70
|
+
const hours = ('0' + date.getUTCHours()).slice(-2);
|
|
71
|
+
const minutes = ('0' + date.getUTCMinutes()).slice(-2);
|
|
72
|
+
const seconds = ('0' + date.getUTCSeconds()).slice(-2);
|
|
73
|
+
const datetime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds} UTC`;
|
|
74
|
+
return new Date(datetime);
|
|
75
|
+
};
|
|
76
|
+
exports.getUtcDateTime = getUtcDateTime;
|
|
@@ -37,8 +37,8 @@ const useCallOpenApi = (inConfig) => {
|
|
|
37
37
|
/** config about hook*/
|
|
38
38
|
const [config, setConfig] = (0, react_1.useState)(inConfig);
|
|
39
39
|
(0, useGranularHook_1.useGranularEffect)(() => {
|
|
40
|
-
if (JSON.stringify(Object.assign(Object.assign({}, config), { headers: undefined, ssrCacheItems: undefined })) !==
|
|
41
|
-
JSON.stringify(Object.assign(Object.assign({}, inConfig), { headers: undefined, ssrCacheItems: undefined }))) {
|
|
40
|
+
if (JSON.stringify(Object.assign(Object.assign({}, config), { headers: undefined, ssrCacheItems: undefined, overrideAuth: undefined })) !==
|
|
41
|
+
JSON.stringify(Object.assign(Object.assign({}, inConfig), { headers: undefined, ssrCacheItems: undefined, overrideAuth: undefined }))) {
|
|
42
42
|
setConfig(inConfig);
|
|
43
43
|
setResp(Object.assign(Object.assign({}, defaultState(inConfig, true)), { loading: true }));
|
|
44
44
|
void (0, direct_1.callOpenApi)(inConfig).then((r) => setResp((r2) => (Object.assign(Object.assign(Object.assign({}, r2), r), { loading: false }))));
|
package/package.json
CHANGED