Date tests: Fix first day of week calculation for non latin locales

This commit is contained in:
Felix Nagel 2015-11-18 19:43:35 +01:00
parent 9fdefeecb9
commit f646ba97a9

View File

@ -9,10 +9,10 @@ return $.extend( helper, {
getAttributes: function( locale ) {
var globalize = new Globalize( locale ),
weekdayShortFormatter = globalize.dateFormatter( { raw: "EEEEEE" } ),
weekdayNarrowFormatter = globalize.dateFormatter( { raw: "EEEEE" } );
firstDayRaw = globalize.dateFormatter( { raw: "c" } )( new Date( 1970, 0, 3 ) );
return {
firstDay: ( 6 - globalize.dateFormatter( { raw: "c" } )( new Date( 1970, 0, 3 ) ) + 1 ),
firstDay: ( 7 - globalize.parseNumber( firstDayRaw ) ),
formatWeekdayShort: function( date ) {
// Return the short weekday if its length is < 3. Otherwise, its narrow form.