mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
31 lines
940 B
JavaScript
31 lines
940 B
JavaScript
define( [
|
|
"jquery",
|
|
"globalize",
|
|
"lib/helper",
|
|
"globalize/date"
|
|
], function( $, Globalize, helper ) {
|
|
|
|
return $.extend( helper, {
|
|
getAttributes: function( locale ) {
|
|
var globalize = new Globalize( locale ),
|
|
weekdayShortFormatter = globalize.dateFormatter( { raw: "EEEEEE" } ),
|
|
weekdayNarrowFormatter = globalize.dateFormatter( { raw: "EEEEE" } );
|
|
|
|
return {
|
|
firstDay: ( 6 - globalize.dateFormatter( { raw: "c" } )( new Date( 1970, 0, 3 ) ) + 1 ),
|
|
formatWeekdayShort: function( date ) {
|
|
|
|
// Return the short weekday if its length is < 3. Otherwise, its narrow form.
|
|
var shortWeekday = weekdayShortFormatter( date );
|
|
|
|
return shortWeekday.length > 3 ? weekdayNarrowFormatter( date ) : shortWeekday;
|
|
},
|
|
formatWeekdayFull: globalize.dateFormatter( { raw: "EEEE" } ),
|
|
formatMonth: globalize.dateFormatter( { raw: "MMMM" } ),
|
|
formatWeekOfYear: globalize.dateFormatter( { raw: "w" } )
|
|
};
|
|
}
|
|
} );
|
|
|
|
} );
|