@verifiedinc-public/shared-ui-elements 0.14.5-beta.1 → 0.14.5-beta.2

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.
@@ -4,5 +4,4 @@
4
4
  * @param separator
5
5
  */
6
6
  export declare const formatDateMMDDYYYY: (timestamp?: string) => string;
7
- export declare const getMinDateInstance: (minDate?: number, minMonth?: number, minYear?: number) => Date;
8
- export declare const getMaxDateInstance: (allowFutureDates?: boolean) => Date;
7
+ export declare const formatDateToTimestamp: (dateValue: number | string | Date) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verifiedinc-public/shared-ui-elements",
3
- "version": "0.14.5-beta.1",
3
+ "version": "0.14.5-beta.2",
4
4
  "description": "A set of UI components, utilities that is shareable with the core apps.",
5
5
  "private": false,
6
6
  "keywords": [],
package/src/utils/date.ts CHANGED
@@ -21,21 +21,12 @@ export const formatDateMMDDYYYY = (timestamp?: string): string => {
21
21
  return [month, day, year].join('/');
22
22
  };
23
23
 
24
- // Get the minimum date instance with the given date, month, and year.
25
- export const getMinDateInstance = (
26
- minDate = 1,
27
- minMonth = 1,
28
- minYear = 1900,
29
- ): Date => {
30
- return new Date(minYear, minMonth - 1, minDate, 0, 0, 0, 0);
31
- };
24
+ export const formatDateToTimestamp = (
25
+ dateValue: number | string | Date,
26
+ ): string => {
27
+ const date = new Date(dateValue);
32
28
 
33
- // Get the maximum date instance.
34
- export const getMaxDateInstance = (allowFutureDates = true): Date => {
35
- const nowDate = new Date();
36
- const maxDate = allowFutureDates ? 31 : nowDate.getDate();
37
- const maxMonth = allowFutureDates ? 12 : nowDate.getMonth() + 1;
38
- const maxYear = allowFutureDates ? 2200 : nowDate.getFullYear();
29
+ date.setUTCHours(12);
39
30
 
40
- return new Date(maxYear, maxMonth - 1, maxDate, 23, 59, 59, 999);
31
+ return String(+date);
41
32
  };