@dereekb/date 13.4.1 → 13.4.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.
- package/index.cjs.js +2 -11
- package/index.esm.js +2 -11
- package/package.json +5 -5
package/index.cjs.js
CHANGED
|
@@ -2561,7 +2561,6 @@ function _type_of$6(obj) {
|
|
|
2561
2561
|
instance = config;
|
|
2562
2562
|
} else {
|
|
2563
2563
|
var type = typeof config === "undefined" ? "undefined" : _type_of$6(config);
|
|
2564
|
-
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
2565
2564
|
switch(type){
|
|
2566
2565
|
case 'object':
|
|
2567
2566
|
instance = new DateTimezoneUtcNormalInstance(config);
|
|
@@ -2809,7 +2808,6 @@ function _type_of$6(obj) {
|
|
|
2809
2808
|
* @returns a function that sets hours/minutes on dates in the given timezone
|
|
2810
2809
|
*/ function setOnDateWithTimezoneNormalFunction(timezone) {
|
|
2811
2810
|
var timezoneInstance = dateTimezoneUtcNormal(timezone);
|
|
2812
|
-
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
2813
2811
|
var fn = function fn(input) {
|
|
2814
2812
|
var inputDate = input.date, copyFromInput = input.copyFrom, copyHours = input.copyHours, copyMinutes = input.copyMinutes, inputInputType = input.inputType, outputType = input.outputType, inputHours = input.hours, inputMinutes = input.minutes, roundDownToMinute = input.roundDownToMinute;
|
|
2815
2813
|
var DEFAULT_TYPE = 'target';
|
|
@@ -4951,7 +4949,6 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4951
4949
|
priority: priority
|
|
4952
4950
|
} : sorted[i];
|
|
4953
4951
|
next = sorted[i + 1];
|
|
4954
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- next may be undefined when sorted[i+1] is out of bounds
|
|
4955
4952
|
if (next) {
|
|
4956
4953
|
nextStartIndex = next.block.i;
|
|
4957
4954
|
// complete loop once past the max allowed index
|
|
@@ -5068,7 +5065,6 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
5068
5065
|
}
|
|
5069
5066
|
}
|
|
5070
5067
|
}
|
|
5071
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- current may be undefined when sorted is empty
|
|
5072
5068
|
if (current != null) {
|
|
5073
5069
|
// if current != null, then atleast one block was input/remaining.
|
|
5074
5070
|
var lastStartIndex = current.block.i;
|
|
@@ -6833,8 +6829,7 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
|
|
|
6833
6829
|
* simplifyDateCellScheduleDayCodes([2, 4]);
|
|
6834
6830
|
* // Returns [DateCellScheduleDayCode.MONDAY, DateCellScheduleDayCode.WEDNESDAY] // [2, 4]
|
|
6835
6831
|
* ```
|
|
6836
|
-
*/
|
|
6837
|
-
function simplifyDateCellScheduleDayCodes(codes) {
|
|
6832
|
+
*/ function simplifyDateCellScheduleDayCodes(codes) {
|
|
6838
6833
|
var codesSet = new Set(codes);
|
|
6839
6834
|
var result = [];
|
|
6840
6835
|
if (codesSet.size >= 2) {
|
|
@@ -6916,7 +6911,6 @@ function simplifyDateCellScheduleDayCodes(codes) {
|
|
|
6916
6911
|
var codes = rawDateCellScheduleDayCodes(input);
|
|
6917
6912
|
var days = new Set();
|
|
6918
6913
|
codes.forEach(function(code) {
|
|
6919
|
-
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
6920
6914
|
switch(code){
|
|
6921
6915
|
case 0:
|
|
6922
6916
|
break;
|
|
@@ -6942,7 +6936,6 @@ function simplifyDateCellScheduleDayCodes(codes) {
|
|
|
6942
6936
|
* @returns raw array of day codes with NONE values removed
|
|
6943
6937
|
*/ function rawDateCellScheduleDayCodes(input) {
|
|
6944
6938
|
var dayCodes;
|
|
6945
|
-
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
6946
6939
|
switch(typeof input === "undefined" ? "undefined" : _type_of$2(input)){
|
|
6947
6940
|
case 'string':
|
|
6948
6941
|
dayCodes = _to_consumable_array$2(new Set(input)).map(function(x) {
|
|
@@ -8924,8 +8917,7 @@ function _object_spread_props$3(target, source) {
|
|
|
8924
8917
|
* ```
|
|
8925
8918
|
*
|
|
8926
8919
|
* @returns The nearest valid scheduled date, or the input date if already valid or no schedule is configured.
|
|
8927
|
-
*/
|
|
8928
|
-
key: "clampToSchedule",
|
|
8920
|
+
*/ key: "clampToSchedule",
|
|
8929
8921
|
value: function clampToSchedule() {
|
|
8930
8922
|
var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.date, maxClampDistance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 370;
|
|
8931
8923
|
var nextAvailableDate;
|
|
@@ -9421,7 +9413,6 @@ function _object_spread_props$2(target, source) {
|
|
|
9421
9413
|
case 6:
|
|
9422
9414
|
// 1212AM
|
|
9423
9415
|
removeAmPm(input);
|
|
9424
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- removedPm is set via closure side effect in removeAmPm()
|
|
9425
9416
|
if (removedPm) {
|
|
9426
9417
|
removedPm = input[0] !== '2'; // If 2, ignore the PM part.
|
|
9427
9418
|
}
|
package/index.esm.js
CHANGED
|
@@ -2560,7 +2560,6 @@ function _type_of$6(obj) {
|
|
|
2560
2560
|
instance = config;
|
|
2561
2561
|
} else {
|
|
2562
2562
|
var type = typeof config === "undefined" ? "undefined" : _type_of$6(config);
|
|
2563
|
-
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
2564
2563
|
switch(type){
|
|
2565
2564
|
case 'object':
|
|
2566
2565
|
instance = new DateTimezoneUtcNormalInstance(config);
|
|
@@ -2808,7 +2807,6 @@ function _type_of$6(obj) {
|
|
|
2808
2807
|
* @returns a function that sets hours/minutes on dates in the given timezone
|
|
2809
2808
|
*/ function setOnDateWithTimezoneNormalFunction(timezone) {
|
|
2810
2809
|
var timezoneInstance = dateTimezoneUtcNormal(timezone);
|
|
2811
|
-
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
2812
2810
|
var fn = function fn(input) {
|
|
2813
2811
|
var inputDate = input.date, copyFromInput = input.copyFrom, copyHours = input.copyHours, copyMinutes = input.copyMinutes, inputInputType = input.inputType, outputType = input.outputType, inputHours = input.hours, inputMinutes = input.minutes, roundDownToMinute = input.roundDownToMinute;
|
|
2814
2812
|
var DEFAULT_TYPE = 'target';
|
|
@@ -4950,7 +4948,6 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
4950
4948
|
priority: priority
|
|
4951
4949
|
} : sorted[i];
|
|
4952
4950
|
next = sorted[i + 1];
|
|
4953
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- next may be undefined when sorted[i+1] is out of bounds
|
|
4954
4951
|
if (next) {
|
|
4955
4952
|
nextStartIndex = next.block.i;
|
|
4956
4953
|
// complete loop once past the max allowed index
|
|
@@ -5067,7 +5064,6 @@ function _unsupported_iterable_to_array$6(o, minLen) {
|
|
|
5067
5064
|
}
|
|
5068
5065
|
}
|
|
5069
5066
|
}
|
|
5070
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- current may be undefined when sorted is empty
|
|
5071
5067
|
if (current != null) {
|
|
5072
5068
|
// if current != null, then atleast one block was input/remaining.
|
|
5073
5069
|
var lastStartIndex = current.block.i;
|
|
@@ -6832,8 +6828,7 @@ var DATE_CELL_SCHEDULE_ENCODED_WEEK_REGEX = /^[0-9]{0,9}$/;
|
|
|
6832
6828
|
* simplifyDateCellScheduleDayCodes([2, 4]);
|
|
6833
6829
|
* // Returns [DateCellScheduleDayCode.MONDAY, DateCellScheduleDayCode.WEDNESDAY] // [2, 4]
|
|
6834
6830
|
* ```
|
|
6835
|
-
*/
|
|
6836
|
-
function simplifyDateCellScheduleDayCodes(codes) {
|
|
6831
|
+
*/ function simplifyDateCellScheduleDayCodes(codes) {
|
|
6837
6832
|
var codesSet = new Set(codes);
|
|
6838
6833
|
var result = [];
|
|
6839
6834
|
if (codesSet.size >= 2) {
|
|
@@ -6915,7 +6910,6 @@ function simplifyDateCellScheduleDayCodes(codes) {
|
|
|
6915
6910
|
var codes = rawDateCellScheduleDayCodes(input);
|
|
6916
6911
|
var days = new Set();
|
|
6917
6912
|
codes.forEach(function(code) {
|
|
6918
|
-
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
6919
6913
|
switch(code){
|
|
6920
6914
|
case 0:
|
|
6921
6915
|
break;
|
|
@@ -6941,7 +6935,6 @@ function simplifyDateCellScheduleDayCodes(codes) {
|
|
|
6941
6935
|
* @returns raw array of day codes with NONE values removed
|
|
6942
6936
|
*/ function rawDateCellScheduleDayCodes(input) {
|
|
6943
6937
|
var dayCodes;
|
|
6944
|
-
// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check
|
|
6945
6938
|
switch(typeof input === "undefined" ? "undefined" : _type_of$2(input)){
|
|
6946
6939
|
case 'string':
|
|
6947
6940
|
dayCodes = _to_consumable_array$2(new Set(input)).map(function(x) {
|
|
@@ -8923,8 +8916,7 @@ function _object_spread_props$3(target, source) {
|
|
|
8923
8916
|
* ```
|
|
8924
8917
|
*
|
|
8925
8918
|
* @returns The nearest valid scheduled date, or the input date if already valid or no schedule is configured.
|
|
8926
|
-
*/
|
|
8927
|
-
key: "clampToSchedule",
|
|
8919
|
+
*/ key: "clampToSchedule",
|
|
8928
8920
|
value: function clampToSchedule() {
|
|
8929
8921
|
var date = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.date, maxClampDistance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 370;
|
|
8930
8922
|
var nextAvailableDate;
|
|
@@ -9420,7 +9412,6 @@ function _object_spread_props$2(target, source) {
|
|
|
9420
9412
|
case 6:
|
|
9421
9413
|
// 1212AM
|
|
9422
9414
|
removeAmPm(input);
|
|
9423
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- removedPm is set via closure side effect in removeAmPm()
|
|
9424
9415
|
if (removedPm) {
|
|
9425
9416
|
removedPm = input[0] !== '2'; // If 2, ignore the PM part.
|
|
9426
9417
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dereekb/date",
|
|
3
|
-
"version": "13.4.
|
|
3
|
+
"version": "13.4.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@dereekb/model": "13.4.
|
|
6
|
-
"@dereekb/rxjs": "13.4.
|
|
7
|
-
"@dereekb/util": "13.4.
|
|
5
|
+
"@dereekb/model": "13.4.2",
|
|
6
|
+
"@dereekb/rxjs": "13.4.2",
|
|
7
|
+
"@dereekb/util": "13.4.2",
|
|
8
8
|
"@vvo/tzdb": "^6.0.0",
|
|
9
9
|
"arktype": "^2.2.0",
|
|
10
10
|
"date-fns": "^4.0.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@dereekb/rxjs": "13.4.
|
|
17
|
+
"@dereekb/rxjs": "13.4.2"
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
20
20
|
"./package.json": "./package.json",
|