dce-reactkit 3.3.3-beta.1 → 3.3.4
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/cjs/index.js +16 -13
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/helpers/getLocalTimeInfo.d.ts +19 -0
- package/dist/cjs/types/helpers/getTimeInfoInET.d.ts +5 -2
- package/dist/esm/index.js +16 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/helpers/getLocalTimeInfo.d.ts +19 -0
- package/dist/esm/types/helpers/getTimeInfoInET.d.ts +5 -2
- package/dist/index.d.ts +5 -2
- package/package.json +1 -1
- package/src/client/initClient.tsx +8 -8
- package/src/helpers/getLocalTimeInfo.tsx +55 -0
- package/src/helpers/getTimeInfoInET.tsx +11 -5
package/dist/cjs/index.js
CHANGED
|
@@ -560,15 +560,14 @@ let storedSendRequest;
|
|
|
560
560
|
* @returns sendRequest function
|
|
561
561
|
*/
|
|
562
562
|
const getSendRequest = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
563
|
-
//
|
|
563
|
+
// Track timeout
|
|
564
564
|
let timedOut = false;
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
initialized
|
|
571
|
-
]);
|
|
565
|
+
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
566
|
+
yield waitMs(5000);
|
|
567
|
+
timedOut = true;
|
|
568
|
+
}))(),
|
|
569
|
+
// Wait for initialization
|
|
570
|
+
yield initialized;
|
|
572
571
|
// Error if no send request function
|
|
573
572
|
if (timedOut) {
|
|
574
573
|
showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$1.NoCACCLSendRequestFunction));
|
|
@@ -1304,9 +1303,10 @@ const getOrdinal = (num) => {
|
|
|
1304
1303
|
* Get current time info in US Boston Eastern Time, independent of machine
|
|
1305
1304
|
* timezone
|
|
1306
1305
|
* @author Gabe Abrams
|
|
1307
|
-
* @param [
|
|
1306
|
+
* @param [dateOrTimestamp=now] the date to get info on or a ms since epoch timestamp
|
|
1308
1307
|
* @returns object with timestamp (ms since epoch) and numbers
|
|
1309
|
-
* corresponding to ET time values for year, month, day, hour, minute
|
|
1308
|
+
* corresponding to ET time values for year, month, day, hour, hour12, minute, isPM
|
|
1309
|
+
* where hour is in 24hr time and hour12 is in 12hr time.
|
|
1310
1310
|
*/
|
|
1311
1311
|
const getTimeInfoInET = (dateOrTimestamp) => {
|
|
1312
1312
|
// Create a time string
|
|
@@ -1336,14 +1336,15 @@ const getTimeInfoInET = (dateOrTimestamp) => {
|
|
|
1336
1336
|
const month = Number.parseInt(monthStr, 10);
|
|
1337
1337
|
const day = Number.parseInt(dayStr, 10);
|
|
1338
1338
|
const minute = Number.parseInt(minStr, 10);
|
|
1339
|
-
let
|
|
1339
|
+
let hour12 = Number.parseInt(hourStr, 10);
|
|
1340
1340
|
// Convert from am/pm to 24hr
|
|
1341
1341
|
const isAM = ending.toLowerCase().includes('am');
|
|
1342
1342
|
const isPM = !isAM;
|
|
1343
|
-
|
|
1343
|
+
let hour = hour12;
|
|
1344
|
+
if (isPM && hour12 !== 12) {
|
|
1344
1345
|
hour += 12;
|
|
1345
1346
|
}
|
|
1346
|
-
else if (isAM &&
|
|
1347
|
+
else if (isAM && hour12 === 12) {
|
|
1347
1348
|
hour = 0;
|
|
1348
1349
|
}
|
|
1349
1350
|
// Return
|
|
@@ -1353,6 +1354,8 @@ const getTimeInfoInET = (dateOrTimestamp) => {
|
|
|
1353
1354
|
month,
|
|
1354
1355
|
day,
|
|
1355
1356
|
hour,
|
|
1357
|
+
hour12,
|
|
1358
|
+
isPM,
|
|
1356
1359
|
minute,
|
|
1357
1360
|
};
|
|
1358
1361
|
};
|