dce-reactkit 3.3.4 → 3.3.6

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.
@@ -54,6 +54,7 @@ import canReviewLogs from './helpers/canReviewLogs';
54
54
  import isMobileOrTablet from './helpers/isMobileOrTablet';
55
55
  import extractProp from './helpers/extractProp';
56
56
  import compareArraysByProp from './helpers/compareArraysByProp';
57
+ import getLocalTimeInfo from './helpers/getLocalTimeInfo';
57
58
  import ModalButtonType from './types/ModalButtonType';
58
59
  import ModalSize from './types/ModalSize';
59
60
  import ModalType from './types/ModalType';
@@ -69,4 +70,4 @@ import LogBuiltInMetadata from './types/LogBuiltInMetadata';
69
70
  import LogMetadataType from './types/LogMetadataType';
70
71
  import IntelliTableColumn from './types/IntelliTableColumn';
71
72
  import PickableItem from './components/ItemPicker/types/PickableItem';
72
- export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, initClient, visitServerEndpoint, logClientEvent, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, ParamType, };
73
+ export { AppWrapper, LoadingSpinner, ErrorBox, Modal, TabBox, RadioButton, CheckboxButton, ButtonInputGroup, SimpleDateChooser, Drawer, PopSuccessMark, PopFailureMark, PopPendingMark, CopiableBox, ItemPicker, LogReviewer, IntelliTable, CSVDownloadButton, alert, confirm, showFatalError, ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, DynamicWord, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, stubServerEndpoint, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, canReviewLogs, isMobileOrTablet, extractProp, compareArraysByProp, getLocalTimeInfo, initClient, visitServerEndpoint, logClientEvent, initServer, genRouteHandler, handleError, handleSuccess, initLogCollection, ModalButtonType, ModalSize, ModalType, ReactKitErrorCode, Variant, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, IntelliTableColumn, PickableItem, ParamType, };
package/dist/esm/index.js CHANGED
@@ -5624,6 +5624,54 @@ const compareArraysByProp = (a, b, prop) => {
5624
5624
  });
5625
5625
  };
5626
5626
 
5627
+ /**
5628
+ * Get current time info in local time
5629
+ * @author Gabe Abrams
5630
+ * @param [dateOrTimestamp=now] the date to get info on or a ms since epoch timestamp
5631
+ * @returns object with timestamp (ms since epoch) and numbers
5632
+ * corresponding to time values for year, month, day, hour, hour12, minute, isPM
5633
+ * where hour is in 24hr time and hour12 is in 12hr time.
5634
+ */
5635
+ const getLocalTimeInfo = (dateOrTimestamp) => {
5636
+ // Create a time string
5637
+ let d;
5638
+ if (!dateOrTimestamp) {
5639
+ // Use now
5640
+ d = new Date();
5641
+ }
5642
+ else if (typeof dateOrTimestamp === 'number') {
5643
+ // Convert to date
5644
+ d = new Date(dateOrTimestamp);
5645
+ }
5646
+ else {
5647
+ // Already a date
5648
+ d = dateOrTimestamp;
5649
+ }
5650
+ // Create all time numbers
5651
+ const timestamp = d.getTime();
5652
+ const year = d.getFullYear();
5653
+ const month = d.getMonth() + 1;
5654
+ const day = d.getDate();
5655
+ const hour = d.getHours();
5656
+ const isPM = hour >= 12;
5657
+ let hour12 = hour % 12;
5658
+ if (hour12 === 0) {
5659
+ hour12 = 12;
5660
+ }
5661
+ const minute = d.getMinutes();
5662
+ // Return
5663
+ return {
5664
+ timestamp,
5665
+ year,
5666
+ month,
5667
+ day,
5668
+ hour,
5669
+ hour12,
5670
+ isPM,
5671
+ minute,
5672
+ };
5673
+ };
5674
+
5627
5675
  /**
5628
5676
  * Days of the week
5629
5677
  * @author Gabe Abrams
@@ -5640,5 +5688,5 @@ var DayOfWeek;
5640
5688
  })(DayOfWeek || (DayOfWeek = {}));
5641
5689
  var DayOfWeek$1 = DayOfWeek;
5642
5690
 
5643
- export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DayOfWeek$1 as DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, Variant$1 as Variant, abbreviate, alert$1 as alert, avg, canReviewLogs, ceilToNumDecimals, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genRouteHandler, getHumanReadableDate, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, initClient, initLogCollection, initServer, isMobileOrTablet, logClientEvent, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, visitServerEndpoint, waitMs };
5691
+ export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DayOfWeek$1 as DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, ItemPicker, LoadingSpinner, LogAction$1 as LogAction, LogBuiltInMetadata, LogReviewer, LogSource$1 as LogSource, LogType$1 as LogType, MINUTE_IN_MS, Modal, ModalButtonType$1 as ModalButtonType, ModalSize$1 as ModalSize, ModalType$1 as ModalType, ParamType$1 as ParamType, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode$1 as ReactKitErrorCode, SimpleDateChooser, TabBox, Variant$1 as Variant, abbreviate, alert$1 as alert, avg, canReviewLogs, ceilToNumDecimals, compareArraysByProp, confirm, extractProp, floorToNumDecimals, forceNumIntoBounds, genCSV, genRouteHandler, getHumanReadableDate, getLocalTimeInfo, getMonthName, getOrdinal, getPartOfDay, getTimeInfoInET, handleError, handleSuccess, initClient, initLogCollection, initServer, isMobileOrTablet, logClientEvent, onlyKeepLetters, padDecimalZeros, padZerosLeft, parallelLimit, roundToNumDecimals, showFatalError, startMinWait, stringsToHumanReadableList, stubServerEndpoint, sum, visitServerEndpoint, waitMs };
5644
5692
  //# sourceMappingURL=index.js.map