Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Datepicker Internationalization shortDays bug #8816

@foreverpw

Description

@foreverpw

In src/components/datepicker/js/dateLocaleProvider.js, the $mdDateLocale finally return

      var service = {
        months: this.months || $locale.DATETIME_FORMATS.MONTH,
        shortMonths: this.shortMonths || $locale.DATETIME_FORMATS.SHORTMONTH,
        days: this.days || $locale.DATETIME_FORMATS.DAY,
        shortDays: this.shortDays || defaultShortDays,
        dates: this.dates || defaultDates,
        firstDayOfWeek: this.firstDayOfWeek || 0,
        formatDate: this.formatDate || defaultFormatDate,
        parseDate: this.parseDate || defaultParseDate,
        isDateComplete: this.isDateComplete || defaultIsDateComplete,
        monthHeaderFormatter: this.monthHeaderFormatter || defaultMonthHeaderFormatter,
        monthFormatter: this.monthFormatter || defaultMonthFormatter,
        weekNumberFormatter: this.weekNumberFormatter || defaultWeekNumberFormatter,
        longDateFormatter: this.longDateFormatter || defaultLongDateFormatter,
        msgCalendar: this.msgCalendar || defaultMsgCalendar,
        msgOpenCalendar: this.msgOpenCalendar || defaultMsgOpenCalendar
      };

the shortDays using the defaultShortDays which is:

var defaultShortDays = $locale.DATETIME_FORMATS.DAY.map(function(day) {
    return day[0];
});

For english it's fine, but in chinese days=['星期一','星期二','星期三'....], then the shorDays will be ['星','星','星'.....] .
Why not to use $locale.DATETIME_FORMATS.SHORTDAY like shortMonths.

Metadata

Metadata

Assignees

Labels

has: Pull RequestA PR has been created to address this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions