@cocoar/ui-components 0.1.0-beta.120 → 0.1.0-beta.122
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.
|
@@ -4036,7 +4036,12 @@ class CoarDatePickerComponent extends CoarControlValueAccessor {
|
|
|
4036
4036
|
localizationDataStore = inject(CoarLocalizationDataStore, { optional: true });
|
|
4037
4037
|
overlayRef = null;
|
|
4038
4038
|
/** Current language from localization service (reactive) */
|
|
4039
|
-
currentLanguage =
|
|
4039
|
+
currentLanguage = computed(() => {
|
|
4040
|
+
// Use the language Signal from service if available, otherwise undefined
|
|
4041
|
+
const lang = this.localizationService?.language();
|
|
4042
|
+
console.debug('[CoarDatePicker] currentLanguage computed:', lang);
|
|
4043
|
+
return lang;
|
|
4044
|
+
}, ...(ngDevMode ? [{ debugName: "currentLanguage" }] : []));
|
|
4040
4045
|
// ============================================================
|
|
4041
4046
|
// Inputs
|
|
4042
4047
|
// ============================================================
|
|
@@ -4140,8 +4145,9 @@ class CoarDatePickerComponent extends CoarControlValueAccessor {
|
|
|
4140
4145
|
daysOfWeek = computed(() => {
|
|
4141
4146
|
const locale = this.effectiveLocale();
|
|
4142
4147
|
const firstDay = this.firstDayOfWeek();
|
|
4143
|
-
|
|
4144
|
-
|
|
4148
|
+
const days = getLocalizedWeekdays(locale, firstDay);
|
|
4149
|
+
console.debug('[CoarDatePicker] daysOfWeek - locale:', locale, 'firstDay:', firstDay, 'days:', days);
|
|
4150
|
+
return days;
|
|
4145
4151
|
}, ...(ngDevMode ? [{ debugName: "daysOfWeek" }] : []));
|
|
4146
4152
|
/** Reference to the input element */
|
|
4147
4153
|
inputRef = viewChild('dateInput', ...(ngDevMode ? [{ debugName: "inputRef" }] : []));
|
|
@@ -4217,11 +4223,10 @@ class CoarDatePickerComponent extends CoarControlValueAccessor {
|
|
|
4217
4223
|
* Priority: input locale > locale service language > browser locale
|
|
4218
4224
|
*/
|
|
4219
4225
|
effectiveLocale = computed(() => {
|
|
4220
|
-
// Always re-evaluate navigator.language to ensure fresh browser locale
|
|
4221
4226
|
const localeInput = this.locale();
|
|
4222
4227
|
const currentLang = this.currentLanguage();
|
|
4223
4228
|
const effective = localeInput ?? currentLang ?? navigator.language;
|
|
4224
|
-
console.
|
|
4229
|
+
console.debug('[CoarDatePicker] effectiveLocale - input:', localeInput, 'currentLang:', currentLang, 'effective:', effective);
|
|
4225
4230
|
return effective;
|
|
4226
4231
|
}, ...(ngDevMode ? [{ debugName: "effectiveLocale" }] : []));
|
|
4227
4232
|
/** Whether the picker has an error state */
|
|
@@ -4277,12 +4282,13 @@ class CoarDatePickerComponent extends CoarControlValueAccessor {
|
|
|
4277
4282
|
viewMonth = computed(() => {
|
|
4278
4283
|
const viewMonth = this.viewDate();
|
|
4279
4284
|
const locale = this.effectiveLocale();
|
|
4280
|
-
console.log('[CoarDatePicker] viewMonth computed - locale:', locale, 'month:', viewMonth.month);
|
|
4281
4285
|
const formatter = new Intl.DateTimeFormat(locale, {
|
|
4282
4286
|
month: 'long',
|
|
4283
4287
|
});
|
|
4284
4288
|
const jsDate = new Date(viewMonth.year, viewMonth.month - 1, 1);
|
|
4285
|
-
|
|
4289
|
+
const monthName = formatter.format(jsDate);
|
|
4290
|
+
console.debug('[CoarDatePicker] viewMonth - locale:', locale, 'month:', viewMonth.month, 'name:', monthName);
|
|
4291
|
+
return monthName;
|
|
4286
4292
|
}, ...(ngDevMode ? [{ debugName: "viewMonth" }] : []));
|
|
4287
4293
|
/** Year for calendar header */
|
|
4288
4294
|
viewYear = computed(() => {
|