Datepicker: Use Globalize 1.0.0

- Fix Use narrow day names (e.g., "ﺥ" EEEEE) if short (e.g., "ﺎﻠﺨﻤﻴﺳ" EEE) if
  too lengthy;
This commit is contained in:
Rafael Xavier de Souza 2014-09-04 15:47:48 -03:00 committed by Felix Nagel
parent a16a788943
commit 846852a250

12
external/date.js vendored
View File

@ -137,12 +137,16 @@ $.date.prototype = {
return new Date( year, 1, 29 ).getMonth() == 1; return new Date( year, 1, 29 ).getMonth() == 1;
}, },
weekdays: function() { weekdays: function() {
var result = []; var cldr = Globalize.locale(),
result = [];
for ( var dow = 0; dow < 7; dow++ ) { for ( var dow = 0; dow < 7; dow++ ) {
var day = ( dow + weekdaysRev[ Globalize.locale().supplemental.weekData.firstDay() ] ) % 7; var day = ( dow + weekdaysRev[ cldr.supplemental.weekData.firstDay() ] ) % 7;
result.push({ result.push({
shortname: Globalize.locale().main([ "dates/calendars/gregorian/days/format/short", weekdays[ day ] ]), shortname:
fullname: Globalize.locale().main([ "dates/calendars/gregorian/days/format/wide", weekdays[ day ] ]) cldr.main([ "dates/calendars/gregorian/days/format/short", weekdays[ day ] ]).length > 3 ?
cldr.main([ "dates/calendars/gregorian/days/format/narrow", weekdays[ day ] ]) :
cldr.main([ "dates/calendars/gregorian/days/format/short", weekdays[ day ] ]),
fullname: cldr.main([ "dates/calendars/gregorian/days/format/wide", weekdays[ day ] ])
}); });
} }
return result; return result;