mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Calendar: Fix first day of week calculation for non latin locales
This commit is contained in:
parent
c43149d8a4
commit
9a879d0fdc
@ -196,14 +196,13 @@ return $.widget( "ui.calendar", {
|
|||||||
_setLocale: function( locale, dateFormat ) {
|
_setLocale: function( locale, dateFormat ) {
|
||||||
var globalize = new Globalize( locale ),
|
var globalize = new Globalize( locale ),
|
||||||
weekdayShortFormatter = globalize.dateFormatter( { raw: "EEEEEE" } ),
|
weekdayShortFormatter = globalize.dateFormatter( { raw: "EEEEEE" } ),
|
||||||
weekdayNarrowFormatter = globalize.dateFormatter( { raw: "EEEEE" } );
|
weekdayNarrowFormatter = globalize.dateFormatter( { raw: "EEEEE" } ),
|
||||||
|
firstDayRaw = globalize.dateFormatter( { raw: "c" } )( new Date( 1970, 0, 3 ) );
|
||||||
|
|
||||||
this._format = globalize.dateFormatter( dateFormat );
|
this._format = globalize.dateFormatter( dateFormat );
|
||||||
this._parse = globalize.dateParser( dateFormat );
|
this._parse = globalize.dateParser( dateFormat );
|
||||||
this._calendarDateOptions = {
|
this._calendarDateOptions = {
|
||||||
|
firstDay: ( 7 - globalize.parseNumber( firstDayRaw ) ),
|
||||||
// Calculate localized first day of week (reference is first saturday)
|
|
||||||
firstDay: ( 6 - globalize.dateFormatter( { raw: "c" } )( new Date( 1970, 0, 3 ) ) + 1 ),
|
|
||||||
formatWeekdayShort: function( date ) {
|
formatWeekdayShort: function( date ) {
|
||||||
|
|
||||||
// Return the short weekday if its length is < 3. Otherwise, its narrow form.
|
// Return the short weekday if its length is < 3. Otherwise, its narrow form.
|
||||||
|
Loading…
Reference in New Issue
Block a user