2015-08-25 21:53:03 +00:00
|
|
|
define( [
|
|
|
|
"jquery",
|
|
|
|
"globalize",
|
|
|
|
"lib/helper",
|
|
|
|
"globalize/date"
|
|
|
|
], function( $, Globalize, helper ) {
|
|
|
|
|
|
|
|
return $.extend( helper, {
|
|
|
|
getAttributes: function( locale ) {
|
|
|
|
var globalize = new Globalize( locale ),
|
2015-10-08 13:06:55 +00:00
|
|
|
weekdayShortFormatter = globalize.dateFormatter( { raw: "EEEEEE" } ),
|
|
|
|
weekdayNarrowFormatter = globalize.dateFormatter( { raw: "EEEEE" } );
|
2015-08-25 21:53:03 +00:00
|
|
|
|
|
|
|
return {
|
2015-11-16 21:30:51 +00:00
|
|
|
firstDay: ( 6 - globalize.dateFormatter( { raw: "c" } )( new Date( 1970, 0, 3 ) ) + 1 ),
|
2015-08-25 21:53:03 +00:00
|
|
|
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;
|
|
|
|
},
|
2015-10-08 13:06:55 +00:00
|
|
|
formatWeekdayFull: globalize.dateFormatter( { raw: "EEEE" } ),
|
|
|
|
formatMonth: globalize.dateFormatter( { raw: "MMMM" } ),
|
|
|
|
formatWeekOfYear: globalize.dateFormatter( { raw: "w" } )
|
2015-08-25 21:53:03 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
|
|
|
} );
|