dce-reactkit 3.3.4 → 3.3.5

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/index.d.ts CHANGED
@@ -1066,6 +1066,25 @@ declare const extractProp: (arr: any[], prop: string) => any[];
1066
1066
  */
1067
1067
  declare const compareArraysByProp: (a: any[], b: any[], prop: string) => boolean;
1068
1068
 
1069
+ /**
1070
+ * Get current time info in local time
1071
+ * @author Gabe Abrams
1072
+ * @param [dateOrTimestamp=now] the date to get info on or a ms since epoch timestamp
1073
+ * @returns object with timestamp (ms since epoch) and numbers
1074
+ * corresponding to time values for year, month, day, hour, hour12, minute, isPM
1075
+ * where hour is in 24hr time and hour12 is in 12hr time.
1076
+ */
1077
+ declare const getLocalTimeInfo: (dateOrTimestamp?: number | Date | undefined) => {
1078
+ timestamp: number;
1079
+ year: number;
1080
+ month: number;
1081
+ day: number;
1082
+ hour: number;
1083
+ hour12: number;
1084
+ minute: number;
1085
+ isPM: boolean;
1086
+ };
1087
+
1069
1088
  /**
1070
1089
  * List of error codes built into the react kit
1071
1090
  * @author Gabe Abrams
@@ -1116,4 +1135,4 @@ declare const LogBuiltInMetadata: {
1116
1135
  };
1117
1136
  };
1118
1137
 
1119
- export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogMetadataType, LogReviewer, LogSource, LogType, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode, SimpleDateChooser, TabBox, Variant, abbreviate, 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 };
1138
+ export { AppWrapper, ButtonInputGroup, CSVDownloadButton, CheckboxButton, CopiableBox, DAY_IN_MS, DayOfWeek, Drawer, DynamicWord, ErrorBox, ErrorWithCode, HOUR_IN_MS, IntelliTable, IntelliTableColumn, ItemPicker, LoadingSpinner, Log, LogAction, LogBuiltInMetadata, LogMetadataType, LogReviewer, LogSource, LogType, MINUTE_IN_MS, Modal, ModalButtonType, ModalSize, ModalType, ParamType, PickableItem, PopFailureMark, PopPendingMark, PopSuccessMark, RadioButton, ReactKitErrorCode, SimpleDateChooser, TabBox, Variant, abbreviate, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "3.3.4",
3
+ "version": "3.3.5",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/index.ts CHANGED
@@ -63,6 +63,7 @@ import canReviewLogs from './helpers/canReviewLogs';
63
63
  import isMobileOrTablet from './helpers/isMobileOrTablet';
64
64
  import extractProp from './helpers/extractProp';
65
65
  import compareArraysByProp from './helpers/compareArraysByProp';
66
+ import getLocalTimeInfo from './helpers/getLocalTimeInfo';
66
67
 
67
68
  // Import types
68
69
  import ModalButtonType from './types/ModalButtonType';
@@ -142,6 +143,7 @@ export {
142
143
  isMobileOrTablet,
143
144
  extractProp,
144
145
  compareArraysByProp,
146
+ getLocalTimeInfo,
145
147
  // Client helpers
146
148
  initClient,
147
149
  visitServerEndpoint,