@naturalcycles/js-lib 14.181.0 → 14.182.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/dist/datetime/localDate.d.ts +3 -2
- package/dist/datetime/localDate.js +5 -1
- package/dist/datetime/localTime.d.ts +3 -2
- package/dist/datetime/localTime.js +5 -1
- package/dist-esm/datetime/localDate.js +3 -0
- package/dist-esm/datetime/localTime.js +3 -0
- package/package.json +1 -1
- package/src/datetime/localDate.ts +6 -2
- package/src/datetime/localTime.ts +6 -2
|
@@ -96,10 +96,11 @@ export declare class LocalDate {
|
|
|
96
96
|
/**
|
|
97
97
|
* Shortcut wrapper around `LocalDate.parse` / `LocalDate.today`
|
|
98
98
|
*/
|
|
99
|
-
export declare function localDate(d?: LocalDateInput): LocalDate;
|
|
99
|
+
export declare function localDate(d?: LocalDateInput | null): LocalDate;
|
|
100
|
+
export declare function localDateToday(): LocalDate;
|
|
100
101
|
/**
|
|
101
102
|
* Creates a LocalDate from the input, unless it's falsy - then returns undefined.
|
|
102
103
|
*
|
|
103
104
|
* `localDate` function will instead return LocalDate of today for falsy input.
|
|
104
105
|
*/
|
|
105
|
-
export declare function localDateOrUndefined(d?: LocalDateInput): LocalDate | undefined;
|
|
106
|
+
export declare function localDateOrUndefined(d?: LocalDateInput | null): LocalDate | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.localDateOrUndefined = exports.localDate = exports.LocalDate = void 0;
|
|
3
|
+
exports.localDateOrUndefined = exports.localDateToday = exports.localDate = exports.LocalDate = void 0;
|
|
4
4
|
const assert_1 = require("../error/assert");
|
|
5
5
|
const localTime_1 = require("./localTime");
|
|
6
6
|
const MDAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
@@ -418,6 +418,10 @@ function localDate(d) {
|
|
|
418
418
|
return d ? LocalDate.of(d) : LocalDate.today();
|
|
419
419
|
}
|
|
420
420
|
exports.localDate = localDate;
|
|
421
|
+
function localDateToday() {
|
|
422
|
+
return LocalDate.today();
|
|
423
|
+
}
|
|
424
|
+
exports.localDateToday = localDateToday;
|
|
421
425
|
/**
|
|
422
426
|
* Creates a LocalDate from the input, unless it's falsy - then returns undefined.
|
|
423
427
|
*
|
|
@@ -125,10 +125,11 @@ export declare class LocalTime {
|
|
|
125
125
|
/**
|
|
126
126
|
* Shortcut wrapper around `LocalDate.parse` / `LocalDate.today`
|
|
127
127
|
*/
|
|
128
|
-
export declare function localTime(d?: LocalTimeInput): LocalTime;
|
|
128
|
+
export declare function localTime(d?: LocalTimeInput | null): LocalTime;
|
|
129
|
+
export declare function localTimeNow(): LocalTime;
|
|
129
130
|
/**
|
|
130
131
|
* Creates a LocalTime from the input, unless it's falsy - then returns undefined.
|
|
131
132
|
*
|
|
132
133
|
* `localTime` function will instead return LocalTime of `now` for falsy input.
|
|
133
134
|
*/
|
|
134
|
-
export declare function localTimeOrUndefined(d?: LocalTimeInput): LocalTime | undefined;
|
|
135
|
+
export declare function localTimeOrUndefined(d?: LocalTimeInput | null): LocalTime | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.localTimeOrUndefined = exports.localTime = exports.LocalTime = exports.ISODayOfWeek = void 0;
|
|
3
|
+
exports.localTimeOrUndefined = exports.localTimeNow = exports.localTime = exports.LocalTime = exports.ISODayOfWeek = void 0;
|
|
4
4
|
const assert_1 = require("../error/assert");
|
|
5
5
|
const time_util_1 = require("../time/time.util");
|
|
6
6
|
const localDate_1 = require("./localDate");
|
|
@@ -495,6 +495,10 @@ function localTime(d) {
|
|
|
495
495
|
return d ? LocalTime.of(d) : LocalTime.now();
|
|
496
496
|
}
|
|
497
497
|
exports.localTime = localTime;
|
|
498
|
+
function localTimeNow() {
|
|
499
|
+
return LocalTime.now();
|
|
500
|
+
}
|
|
501
|
+
exports.localTimeNow = localTimeNow;
|
|
498
502
|
/**
|
|
499
503
|
* Creates a LocalTime from the input, unless it's falsy - then returns undefined.
|
|
500
504
|
*
|
|
@@ -413,6 +413,9 @@ export class LocalDate {
|
|
|
413
413
|
export function localDate(d) {
|
|
414
414
|
return d ? LocalDate.of(d) : LocalDate.today();
|
|
415
415
|
}
|
|
416
|
+
export function localDateToday() {
|
|
417
|
+
return LocalDate.today();
|
|
418
|
+
}
|
|
416
419
|
/**
|
|
417
420
|
* Creates a LocalDate from the input, unless it's falsy - then returns undefined.
|
|
418
421
|
*
|
|
@@ -491,6 +491,9 @@ export class LocalTime {
|
|
|
491
491
|
export function localTime(d) {
|
|
492
492
|
return d ? LocalTime.of(d) : LocalTime.now();
|
|
493
493
|
}
|
|
494
|
+
export function localTimeNow() {
|
|
495
|
+
return LocalTime.now();
|
|
496
|
+
}
|
|
494
497
|
/**
|
|
495
498
|
* Creates a LocalTime from the input, unless it's falsy - then returns undefined.
|
|
496
499
|
*
|
package/package.json
CHANGED
|
@@ -507,15 +507,19 @@ export class LocalDate {
|
|
|
507
507
|
/**
|
|
508
508
|
* Shortcut wrapper around `LocalDate.parse` / `LocalDate.today`
|
|
509
509
|
*/
|
|
510
|
-
export function localDate(d?: LocalDateInput): LocalDate {
|
|
510
|
+
export function localDate(d?: LocalDateInput | null): LocalDate {
|
|
511
511
|
return d ? LocalDate.of(d) : LocalDate.today()
|
|
512
512
|
}
|
|
513
513
|
|
|
514
|
+
export function localDateToday(): LocalDate {
|
|
515
|
+
return LocalDate.today()
|
|
516
|
+
}
|
|
517
|
+
|
|
514
518
|
/**
|
|
515
519
|
* Creates a LocalDate from the input, unless it's falsy - then returns undefined.
|
|
516
520
|
*
|
|
517
521
|
* `localDate` function will instead return LocalDate of today for falsy input.
|
|
518
522
|
*/
|
|
519
|
-
export function localDateOrUndefined(d?: LocalDateInput): LocalDate | undefined {
|
|
523
|
+
export function localDateOrUndefined(d?: LocalDateInput | null): LocalDate | undefined {
|
|
520
524
|
return d ? LocalDate.of(d) : undefined
|
|
521
525
|
}
|
|
@@ -599,16 +599,20 @@ export class LocalTime {
|
|
|
599
599
|
/**
|
|
600
600
|
* Shortcut wrapper around `LocalDate.parse` / `LocalDate.today`
|
|
601
601
|
*/
|
|
602
|
-
export function localTime(d?: LocalTimeInput): LocalTime {
|
|
602
|
+
export function localTime(d?: LocalTimeInput | null): LocalTime {
|
|
603
603
|
return d ? LocalTime.of(d) : LocalTime.now()
|
|
604
604
|
}
|
|
605
605
|
|
|
606
|
+
export function localTimeNow(): LocalTime {
|
|
607
|
+
return LocalTime.now()
|
|
608
|
+
}
|
|
609
|
+
|
|
606
610
|
/**
|
|
607
611
|
* Creates a LocalTime from the input, unless it's falsy - then returns undefined.
|
|
608
612
|
*
|
|
609
613
|
* `localTime` function will instead return LocalTime of `now` for falsy input.
|
|
610
614
|
*/
|
|
611
|
-
export function localTimeOrUndefined(d?: LocalTimeInput): LocalTime | undefined {
|
|
615
|
+
export function localTimeOrUndefined(d?: LocalTimeInput | null): LocalTime | undefined {
|
|
612
616
|
return d ? LocalTime.of(d) : undefined
|
|
613
617
|
}
|
|
614
618
|
|