@dereekb/date 12.5.9 → 12.6.0
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/index.cjs.js +13 -9
- package/index.esm.js +3 -3
- package/package.json +1 -1
- package/src/lib/date/date.unix.d.ts +1 -1
- package/src/lib/expires/expires.d.ts +3 -3
package/index.cjs.js
CHANGED
|
@@ -8258,7 +8258,7 @@ function timeHasExpired(time, expiresIn) {
|
|
|
8258
8258
|
* @param expiresIn If the input number is the initial date, and not the expiration date, this is used to find the expiresAt time.
|
|
8259
8259
|
*/
|
|
8260
8260
|
function toExpires(time, expiresIn) {
|
|
8261
|
-
let expiresAt = util.
|
|
8261
|
+
let expiresAt = util.dateFromDateOrTimeMillisecondsNumber(time);
|
|
8262
8262
|
if (expiresAt && expiresIn != null) {
|
|
8263
8263
|
expiresAt = dateFns.addMilliseconds(expiresAt, expiresIn);
|
|
8264
8264
|
}
|
|
@@ -9114,25 +9114,29 @@ class ModelRecurrenceInfoUtility {
|
|
|
9114
9114
|
}
|
|
9115
9115
|
}
|
|
9116
9116
|
|
|
9117
|
+
Object.defineProperty(exports, "dateFromDateOrTimeMillisecondsNumber", {
|
|
9118
|
+
enumerable: true,
|
|
9119
|
+
get: function () { return util.dateFromDateOrTimeMillisecondsNumber; }
|
|
9120
|
+
});
|
|
9117
9121
|
Object.defineProperty(exports, "dateFromDateOrTimeNumber", {
|
|
9118
9122
|
enumerable: true,
|
|
9119
9123
|
get: function () { return util.dateFromDateOrTimeNumber; }
|
|
9120
9124
|
});
|
|
9121
|
-
Object.defineProperty(exports, "
|
|
9125
|
+
Object.defineProperty(exports, "unixDateTimeSecondsNumberForNow", {
|
|
9122
9126
|
enumerable: true,
|
|
9123
|
-
get: function () { return util.
|
|
9127
|
+
get: function () { return util.unixDateTimeSecondsNumberForNow; }
|
|
9124
9128
|
});
|
|
9125
|
-
Object.defineProperty(exports, "
|
|
9129
|
+
Object.defineProperty(exports, "unixDateTimeSecondsNumberFromDate", {
|
|
9126
9130
|
enumerable: true,
|
|
9127
|
-
get: function () { return util.
|
|
9131
|
+
get: function () { return util.unixDateTimeSecondsNumberFromDate; }
|
|
9128
9132
|
});
|
|
9129
|
-
Object.defineProperty(exports, "
|
|
9133
|
+
Object.defineProperty(exports, "unixDateTimeSecondsNumberFromDateOrTimeNumber", {
|
|
9130
9134
|
enumerable: true,
|
|
9131
|
-
get: function () { return util.
|
|
9135
|
+
get: function () { return util.unixDateTimeSecondsNumberFromDateOrTimeNumber; }
|
|
9132
9136
|
});
|
|
9133
|
-
Object.defineProperty(exports, "
|
|
9137
|
+
Object.defineProperty(exports, "unixDateTimeSecondsNumberToDate", {
|
|
9134
9138
|
enumerable: true,
|
|
9135
|
-
get: function () { return util.
|
|
9139
|
+
get: function () { return util.unixDateTimeSecondsNumberToDate; }
|
|
9136
9140
|
});
|
|
9137
9141
|
exports.AnyIterResult = AnyIterResult;
|
|
9138
9142
|
exports.CalendarDate = CalendarDate;
|
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MS_IN_HOUR, MS_IN_MINUTE, MINUTES_IN_DAY, isISO8601DateString, filterMaybeArrayValues, asArray, dayOfWeek, sortNumbersAscendingFunction, MS_IN_SECOND, SORT_VALUE_LESS_THAN, SORT_VALUE_GREATER_THAN, SORT_VALUE_EQUAL, copyArray, compareFnOrder, groupValues, daysOfWeekArray, MS_IN_DAY, minutesToFractionalHours, safeCompareEquality, DATE_NOW_VALUE, mapIdentityFunction, UTC_TIMEZONE_STRING, isSameNonNullValue, isConsideredUtcTimezoneString, cachedGetter, parseISO8601DayStringToUTCDate, replaceStringsFunction, repeatString, isEqualDate, startOfDayForUTCDateInUTC, sortAscendingIndexNumberRefFunction, range, pushArrayItemsIntoArray, sumOfIntegersBetween, makeValuesGroupMap, lastValue, asGetter, indexRangeCheckFunction, mergeFilterFunctions, isDate as isDate$2, HOURS_IN_DAY, getNextDay, enabledDaysFromDaysOfWeek, daysOfWeekFromEnabledDays, firstValueFromIterable, forEachInIterable, addToSet, iterablesAreSetEquivalent, invertFilter, HashSet, roundNumberUpToStep, protectedFactory, TimeAM, isLogicalDateStringCode as isLogicalDateStringCode$1, dateFromLogicalDate as dateFromLogicalDate$1,
|
|
2
|
-
export { dateFromDateOrTimeNumber,
|
|
1
|
+
import { MS_IN_HOUR, MS_IN_MINUTE, MINUTES_IN_DAY, isISO8601DateString, filterMaybeArrayValues, asArray, dayOfWeek, sortNumbersAscendingFunction, MS_IN_SECOND, SORT_VALUE_LESS_THAN, SORT_VALUE_GREATER_THAN, SORT_VALUE_EQUAL, copyArray, compareFnOrder, groupValues, daysOfWeekArray, MS_IN_DAY, minutesToFractionalHours, safeCompareEquality, DATE_NOW_VALUE, mapIdentityFunction, UTC_TIMEZONE_STRING, isSameNonNullValue, isConsideredUtcTimezoneString, cachedGetter, parseISO8601DayStringToUTCDate, replaceStringsFunction, repeatString, isEqualDate, startOfDayForUTCDateInUTC, sortAscendingIndexNumberRefFunction, range, pushArrayItemsIntoArray, sumOfIntegersBetween, makeValuesGroupMap, lastValue, asGetter, indexRangeCheckFunction, mergeFilterFunctions, isDate as isDate$2, HOURS_IN_DAY, getNextDay, enabledDaysFromDaysOfWeek, daysOfWeekFromEnabledDays, firstValueFromIterable, forEachInIterable, addToSet, iterablesAreSetEquivalent, invertFilter, HashSet, roundNumberUpToStep, protectedFactory, TimeAM, isLogicalDateStringCode as isLogicalDateStringCode$1, dateFromLogicalDate as dateFromLogicalDate$1, dateFromDateOrTimeMillisecondsNumber, flattenArray, splitJoinRemainder } from '@dereekb/util';
|
|
2
|
+
export { dateFromDateOrTimeMillisecondsNumber, dateFromDateOrTimeNumber, unixDateTimeSecondsNumberForNow, unixDateTimeSecondsNumberFromDate, unixDateTimeSecondsNumberFromDateOrTimeNumber, unixDateTimeSecondsNumberToDate } from '@dereekb/util';
|
|
3
3
|
import { isDate as isDate$1, startOfMinute, isValid, parseISO, min as min$2, max as max$2, isAfter as isAfter$1, isBefore as isBefore$1, isEqual, isSameDay, isPast, addDays, set as set$1, differenceInDays, startOfMonth, endOfWeek, startOfWeek, endOfMonth, addHours, addMinutes, addMilliseconds, startOfDay, addMonths, addWeeks, endOfDay, endOfHour, startOfHour, endOfMinute, differenceInMinutes, millisecondsToHours, millisecondsToMinutes, differenceInHours, formatDistanceStrict, formatDistance, format as format$1, formatDistanceToNow, parse, getMinutes, getSeconds, getMilliseconds, differenceInMilliseconds, getWeek, getYear, setWeek, getDay, addSeconds } from 'date-fns';
|
|
4
4
|
import { Expose, Type, Exclude } from 'class-transformer';
|
|
5
5
|
import { IsDate, IsEnum, IsOptional, IsNumber, Min, registerDecorator, buildMessage, IsString, Matches, IsArray, IsBoolean } from 'class-validator';
|
|
@@ -8257,7 +8257,7 @@ function timeHasExpired(time, expiresIn) {
|
|
|
8257
8257
|
* @param expiresIn If the input number is the initial date, and not the expiration date, this is used to find the expiresAt time.
|
|
8258
8258
|
*/
|
|
8259
8259
|
function toExpires(time, expiresIn) {
|
|
8260
|
-
let expiresAt =
|
|
8260
|
+
let expiresAt = dateFromDateOrTimeMillisecondsNumber(time);
|
|
8261
8261
|
if (expiresAt && expiresIn != null) {
|
|
8262
8262
|
expiresAt = addMilliseconds(expiresAt, expiresIn);
|
|
8263
8263
|
}
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { unixDateTimeSecondsNumberFromDateOrTimeNumber, unixDateTimeSecondsNumberForNow, unixDateTimeSecondsNumberFromDate, dateFromDateOrTimeNumber, dateFromDateOrTimeMillisecondsNumber, unixDateTimeSecondsNumberToDate } from '@dereekb/util';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Expires, type
|
|
1
|
+
import { type Expires, type DateOrUnixDateTimeMillisecondsNumber, type Maybe, type Milliseconds } from '@dereekb/util';
|
|
2
2
|
export type { Expires } from '@dereekb/util';
|
|
3
3
|
/**
|
|
4
4
|
* Returns true if any of the input items have expired.
|
|
@@ -25,7 +25,7 @@ export declare function anyHaveExpired(expires: Maybe<Expires>[], expireIfEmpty?
|
|
|
25
25
|
*
|
|
26
26
|
* @deprecated Use isThrottled() or expirationDetails({ expiresFromDate: time, expiresIn }).hasExpired() instead.
|
|
27
27
|
*/
|
|
28
|
-
export declare function timeHasExpired(time: Maybe<
|
|
28
|
+
export declare function timeHasExpired(time: Maybe<DateOrUnixDateTimeMillisecondsNumber>, expiresIn?: Milliseconds): boolean;
|
|
29
29
|
/**
|
|
30
30
|
* Creates an Expires object from the input date or time number.
|
|
31
31
|
*
|
|
@@ -34,7 +34,7 @@ export declare function timeHasExpired(time: Maybe<DateOrUnixDateTimeNumber>, ex
|
|
|
34
34
|
* @param timeNumber Number to convert to a date.
|
|
35
35
|
* @param expiresIn If the input number is the initial date, and not the expiration date, this is used to find the expiresAt time.
|
|
36
36
|
*/
|
|
37
|
-
export declare function toExpires(time: Maybe<
|
|
37
|
+
export declare function toExpires(time: Maybe<DateOrUnixDateTimeMillisecondsNumber>, expiresIn?: Milliseconds): Expires;
|
|
38
38
|
/**
|
|
39
39
|
* Checks whether or not the item has expired. If no expiration date is set, it is considered expired.
|
|
40
40
|
*
|