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

Commit 68b7121

Browse files
crisbetoThomasBurleson
authored andcommitted
fix(datepicker): use the short days from the locale
The datepicker was taking the first letter of the DAY in the $locale, instead of using the SHORTDAY. Fixes #8816. Closes #8838
1 parent ec2726e commit 68b7121

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/components/datepicker/js/dateLocale.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ describe('$mdDateLocale', function() {
66
var $localeFake = {
77
DATETIME_FORMATS: {
88
DAY: ['Sundog', 'Mondog', 'Tuesdog', 'Wednesdog', 'Thursdog', 'Fridog', 'Saturdog'],
9+
SHORTDAY: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
910
MONTH: ['JanZ', 'FebZ', 'MarZ', 'AprZ', 'MayZ', 'JunZ', 'JulZ', 'AugZ', 'SeptZ',
1011
'OctZ', 'NovZ', 'DecZ'],
1112
SHORTMONTH: ['JZ', 'FZ', 'MZ', 'AZ', 'MZ', 'JZ', 'JZ', 'AZ', 'SZ', 'OZ', 'NZ', 'DZ']

src/components/datepicker/js/dateLocaleProvider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@
248248

249249
// The default "short" day strings are the first character of each day,
250250
// e.g., "Monday" => "M".
251-
var defaultShortDays = $locale.DATETIME_FORMATS.DAY.map(function(day) {
252-
return day[0];
251+
var defaultShortDays = $locale.DATETIME_FORMATS.SHORTDAY.map(function(day) {
252+
return day.substring(0, 1);
253253
});
254254

255255
// The default dates are simply the numbers 1 through 31.

0 commit comments

Comments
 (0)