[ljcom] r13075: LJSUP-14706: Month Format on Calendar
Committer: anazarov
LJSUP-14706: Month Format on CalendarU trunk/htdocs/js/jquery/jquery.lj.inlineCalendar.js
Modified: trunk/htdocs/js/jquery/jquery.lj.inlineCalendar.js
===================================================================
--- trunk/htdocs/js/jquery/jquery.lj.inlineCalendar.js 2012-12-25 12:00:30 UTC (rev 13074)
+++ trunk/htdocs/js/jquery/jquery.lj.inlineCalendar.js 2012-12-25 15:48:21 UTC (rev 13075)
@@ -66,6 +66,7 @@
startAtSunday: !(LiveJournal.getLocalizedStr('date.format.offset') !== '0') || false,
dateFormat: "%Y-%M-%D",
defaultTitle: "Calendar",
+ longMonth: false,
events: null, //object with events to show in the calendar
displayedMonth: null, //month displayed on the calendar. If not specified at
@@ -99,7 +100,8 @@
weekend: 'weekend',
nextDisabled : 'cal-nav-next-dis',
prevDisabled : 'cal-nav-prev-dis',
- cellHover : 'hover'
+ cellHover : 'hover',
+ longMonth: 'sidebar-cal-longmonth'
},
//now, all lang variables are collected from Site.ml_text and should not be modified
@@ -144,6 +146,7 @@
this.modelChanged = function (monthDate, events, switcherStates)
{
+ var monthml = o.longMonth? o.ml.monthNamesLong : o.ml.monthNamesShort;
//we have a 30% speedup when we temporary remove tbody from dom
this.tbody.detach();
this.fillDates(monthDate, events);
@@ -153,8 +156,8 @@
}
var monthText = o.monthRef
- ? $( '<a>', { href: LJ.Util.Date.format( monthDate, o.monthRef ), text: o.ml.monthNamesShort[ monthDate.getMonth() ] } )
- : o.ml.monthNamesShort[ monthDate.getMonth() ];
+ ? $( '<a>', { href: LJ.Util.Date.format( monthDate, o.monthRef ), text: monthml[ monthDate.getMonth() ] } )
+ : monthml[ monthDate.getMonth() ];
var yearText = o.yearRef
? $( '<a>', { href: LJ.Util.Date.format( monthDate, o.yearRef ), text: monthDate.getFullYear() } )
@@ -359,6 +362,10 @@
this._hideTimer = null;
this._nodes = this._nodes || { container: this.element, root: this.element };
this._invalidateTimer = null;
+
+ if (this.element.hasClass(this.options.classNames.longMonth)) {
+ this.options.longMonth = true;
+ }
this._bindNodes();
