@mll-lab/js-utils 2.28.0 → 2.29.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/date.d.ts +2 -0
- package/dist/index.common.js +8 -0
- package/dist/index.common.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/date.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare function isToday(date: Date | string | number): boolean;
|
|
2
2
|
export declare function isFuture(date: Date | string | number): boolean;
|
|
3
|
+
export declare function isValidGermanDate(date: string): boolean;
|
|
4
|
+
export declare function isTimeWithHoursAndMinutes(time: string): boolean;
|
|
3
5
|
export declare function parseDate(value: string, formatString: string): Date | null;
|
|
4
6
|
export declare function parseGermanDateFlexible(value: string): Date | null;
|
|
5
7
|
export declare const GERMAN_DATE_FORMAT = "dd.MM.y";
|
package/dist/index.common.js
CHANGED
|
@@ -16168,6 +16168,12 @@ function isToday(date) {
|
|
|
16168
16168
|
function isFuture(date) {
|
|
16169
16169
|
return isAfter(date, new Date());
|
|
16170
16170
|
}
|
|
16171
|
+
function isValidGermanDate(date) {
|
|
16172
|
+
return /^(\d{1,2}[.]\d{1,2}[.]\d{4})$/.test(date);
|
|
16173
|
+
}
|
|
16174
|
+
function isTimeWithHoursAndMinutes(time) {
|
|
16175
|
+
return /^(\d{2}:\d{2})$/.test(time);
|
|
16176
|
+
}
|
|
16171
16177
|
function parseDate(value, formatString) {
|
|
16172
16178
|
const parsedDate = parse(value, formatString, new Date());
|
|
16173
16179
|
return isValid(parsedDate) ? parsedDate : null;
|
|
@@ -16590,8 +16596,10 @@ exports.isOnlyDigits = isOnlyDigits;
|
|
|
16590
16596
|
exports.isPartialGermanNumber = isPartialGermanNumber;
|
|
16591
16597
|
exports.isRackBarcode = isRackBarcode;
|
|
16592
16598
|
exports.isString = isString;
|
|
16599
|
+
exports.isTimeWithHoursAndMinutes = isTimeWithHoursAndMinutes;
|
|
16593
16600
|
exports.isToday = isToday;
|
|
16594
16601
|
exports.isURL = isURL;
|
|
16602
|
+
exports.isValidGermanDate = isValidGermanDate;
|
|
16595
16603
|
exports.isWord = isWord;
|
|
16596
16604
|
exports.isZeroish = isZeroish;
|
|
16597
16605
|
exports.joinNonEmpty = joinNonEmpty;
|