@tstdl/base 0.93.66 → 0.93.67
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/package.json +1 -1
- package/utils/date-time.d.ts +2 -2
- package/utils/date-time.js +2 -2
package/package.json
CHANGED
package/utils/date-time.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare function dateTimeToTime(dateTime: DateTime): number;
|
|
|
58
58
|
export declare function numericDateTimeToDateTime({ date, time }: NumericDateTime, zone?: string): DateTime;
|
|
59
59
|
/** Converts a timestamp, Date, DateTime, ISO date string, or DateObject to a numeric date */
|
|
60
60
|
export declare function toNumericDate(value: number | Date | DateTime | string | DateObject): number;
|
|
61
|
-
export declare function toNumericDate
|
|
61
|
+
export declare function toNumericDate(value: number | Date | DateTime | string | DateObject | null | undefined): number | null;
|
|
62
62
|
/** Converts a numeric date to an ISO date string (YYYY-MM-DD) */
|
|
63
63
|
export declare function numericDateToIsoDate(numericDate: number): string;
|
|
64
|
-
export declare function numericDateToIsoDate
|
|
64
|
+
export declare function numericDateToIsoDate(numericDate: number | null | undefined): string | null;
|
package/utils/date-time.js
CHANGED
|
@@ -129,7 +129,7 @@ export function numericDateTimeToDateTime({ date, time }, zone) {
|
|
|
129
129
|
}
|
|
130
130
|
export function toNumericDate(value) {
|
|
131
131
|
if (isNullOrUndefined(value)) {
|
|
132
|
-
return
|
|
132
|
+
return null;
|
|
133
133
|
}
|
|
134
134
|
if (isNumber(value)) {
|
|
135
135
|
return timestampToNumericDate(value);
|
|
@@ -154,7 +154,7 @@ export function toNumericDate(value) {
|
|
|
154
154
|
}
|
|
155
155
|
export function numericDateToIsoDate(numericDate) {
|
|
156
156
|
if (isNullOrUndefined(numericDate)) {
|
|
157
|
-
return
|
|
157
|
+
return null;
|
|
158
158
|
}
|
|
159
159
|
const { year, month, day } = numericDateToDateObject(numericDate);
|
|
160
160
|
const monthString = month.toString().padStart(2, '0');
|