novo-elements 10.15.0 → 10.16.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/elements/field/formats/date-format.d.ts +5 -3
- package/elements/field/formats/date-range-format.d.ts +5 -32
- package/elements/field/formats/date-time-format.d.ts +6 -4
- package/esm2022/elements/field/formats/date-format.mjs +22 -16
- package/esm2022/elements/field/formats/date-range-format.mjs +13 -41
- package/esm2022/elements/field/formats/date-time-format.mjs +29 -17
- package/esm2022/services/date-format/DateFormat.mjs +22 -1
- package/esm2022/utils/date/Date.mjs +31 -1
- package/esm2022/utils/date/legacy-parse.mjs +2 -2
- package/fesm2022/novo-elements-elements-field.mjs +59 -69
- package/fesm2022/novo-elements-elements-field.mjs.map +1 -1
- package/fesm2022/novo-elements-services.mjs +21 -0
- package/fesm2022/novo-elements-services.mjs.map +1 -1
- package/fesm2022/novo-elements-utils.mjs +31 -1
- package/fesm2022/novo-elements-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/services/date-format/DateFormat.d.ts +2 -0
- package/utils/date/Date.d.ts +6 -2
- package/utils/date/legacy-parse.d.ts +7 -0
package/package.json
CHANGED
|
@@ -3,12 +3,14 @@ import { MaskedOptions } from 'imask';
|
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class DateFormatService {
|
|
5
5
|
private labels;
|
|
6
|
+
readonly dateFormatAsImaskPattern: string;
|
|
6
7
|
constructor(labels: NovoLabelService);
|
|
7
8
|
getTimeMask(militaryTime: boolean): MaskedOptions;
|
|
8
9
|
getDateMask(): MaskedOptions;
|
|
9
10
|
getDateTimeMask(militaryTime?: boolean): Array<any>;
|
|
10
11
|
getTimePlaceHolder(militaryTime: boolean): string;
|
|
11
12
|
parseCustomDateString(dateString: string, customFormat?: string): [Date, string, boolean];
|
|
13
|
+
private dateFormatToImaskPattern;
|
|
12
14
|
/**
|
|
13
15
|
* Certain date format characters are considered nonstandard. We can still use them, but remove them for date parsing to avoid errors
|
|
14
16
|
* @param dateString
|
package/utils/date/Date.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Day } from 'date-fns';
|
|
2
2
|
import { LegacyParseOptions } from './legacy-parse';
|
|
3
3
|
type DateLike = Date | string | number;
|
|
4
|
+
export interface DateParseOptions extends LegacyParseOptions {
|
|
5
|
+
userDateFormat?: string;
|
|
6
|
+
}
|
|
4
7
|
/**
|
|
5
8
|
* This DateUtil is a wrapper for calling new date-fns v2 functions with existing legacy
|
|
6
9
|
* v1 function calls without having to refactor too much code and potentially introduce
|
|
@@ -17,8 +20,8 @@ type DateLike = Date | string | number;
|
|
|
17
20
|
export declare class DateUtil {
|
|
18
21
|
static getDateFromAnyType(date: DateLike): Date | number;
|
|
19
22
|
static getWeekDayFromNumber(weekDay: number | Day): Day;
|
|
20
|
-
static parse(date: any, options?:
|
|
21
|
-
static format(date: any, formatString:
|
|
23
|
+
static parse(date: any, options?: DateParseOptions): Date;
|
|
24
|
+
static format(date: any, formatString: string): string;
|
|
22
25
|
static addDays(date: any, days: number): Date;
|
|
23
26
|
static addWeeks(date: any, weeks: number): Date;
|
|
24
27
|
static addMonths(date: any, months: number): Date;
|
|
@@ -42,5 +45,6 @@ export declare class DateUtil {
|
|
|
42
45
|
static setHours(date: DateLike, hours: number): Date;
|
|
43
46
|
static isBefore(date: DateLike, minDate: Date | number): boolean;
|
|
44
47
|
static isAfter(date: DateLike, maxDate: Date | number): boolean;
|
|
48
|
+
static rewireDatePositionsToMDY(dateStr: string, userDateFormat: string): string;
|
|
45
49
|
}
|
|
46
50
|
export {};
|
|
@@ -6,3 +6,10 @@ export type LegacyParseOptions = {
|
|
|
6
6
|
additionalDigits?: 0 | 1 | 2;
|
|
7
7
|
};
|
|
8
8
|
export declare function legacyParse(argument: any, options?: LegacyParseOptions): Date;
|
|
9
|
+
type DateStrings = {
|
|
10
|
+
date: string | undefined;
|
|
11
|
+
time: string | undefined;
|
|
12
|
+
timezone: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare function splitDateString(dateString: string): DateStrings;
|
|
15
|
+
export {};
|