@full-ui/headless-calendar 7.0.0-rc.2 → 7.0.0-rc.3
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.d.ts +3 -3
- package/index.js +5 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ interface DateFormattingContext {
|
|
|
128
128
|
locale: Locale;
|
|
129
129
|
calendarSystem: CalendarSystem;
|
|
130
130
|
computeWeekNumber: (d: DateMarker) => number;
|
|
131
|
-
|
|
131
|
+
weekTextLong: string;
|
|
132
132
|
weekTextShort: string;
|
|
133
133
|
cmdFormatter?: CmdDateFormatterFunc;
|
|
134
134
|
}
|
|
@@ -152,7 +152,7 @@ interface DateEnvSettings {
|
|
|
152
152
|
locale: Locale;
|
|
153
153
|
weekNumberCalculation?: WeekNumberCalculation;
|
|
154
154
|
firstDay?: number;
|
|
155
|
-
|
|
155
|
+
weekTextLong?: string;
|
|
156
156
|
weekTextShort?: string;
|
|
157
157
|
cmdFormatter?: CmdDateFormatterFunc;
|
|
158
158
|
}
|
|
@@ -168,7 +168,7 @@ declare class DateEnv {
|
|
|
168
168
|
weekDow: number;
|
|
169
169
|
weekDoy: number;
|
|
170
170
|
weekNumberFunc: any;
|
|
171
|
-
|
|
171
|
+
weekTextLong: string;
|
|
172
172
|
weekTextShort: string;
|
|
173
173
|
cmdFormatter?: CmdDateFormatterFunc;
|
|
174
174
|
constructor(settings: DateEnvSettings);
|
package/index.js
CHANGED
|
@@ -576,8 +576,8 @@ class DateEnv {
|
|
|
576
576
|
if (typeof settings.weekNumberCalculation === 'function') {
|
|
577
577
|
this.weekNumberFunc = settings.weekNumberCalculation;
|
|
578
578
|
}
|
|
579
|
-
this.
|
|
580
|
-
this.weekTextShort = settings.weekTextShort ?? settings.
|
|
579
|
+
this.weekTextLong = settings.weekTextLong;
|
|
580
|
+
this.weekTextShort = settings.weekTextShort ?? settings.weekTextLong;
|
|
581
581
|
this.cmdFormatter = settings.cmdFormatter;
|
|
582
582
|
}
|
|
583
583
|
// Creating / Parsing
|
|
@@ -907,7 +907,7 @@ class NativeDateFormatter {
|
|
|
907
907
|
}];
|
|
908
908
|
}
|
|
909
909
|
if (this.weekOnly) {
|
|
910
|
-
return formatWeekNumberParts(context.computeWeekNumber(date.marker), context.
|
|
910
|
+
return formatWeekNumberParts(context.computeWeekNumber(date.marker), context.weekTextLong, context.weekTextShort, context.locale, extendedOptions.week);
|
|
911
911
|
}
|
|
912
912
|
const { normalFormat, zeroFormat } = this.getFormats(context);
|
|
913
913
|
const format = (zeroFormat && !date.marker.getUTCMinutes())
|
|
@@ -1054,10 +1054,10 @@ function stripTrailingLiteral(parts) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
|
-
function formatWeekNumberParts(num,
|
|
1057
|
+
function formatWeekNumberParts(num, weekTextLong, weekTextShort, locale, display) {
|
|
1058
1058
|
const parts = [];
|
|
1059
1059
|
if (display === 'long') {
|
|
1060
|
-
parts.push({ type: 'literal', value:
|
|
1060
|
+
parts.push({ type: 'literal', value: weekTextLong });
|
|
1061
1061
|
}
|
|
1062
1062
|
else if (display === 'short' || display === 'narrow') {
|
|
1063
1063
|
parts.push({ type: 'literal', value: weekTextShort });
|