js/datetime/calendar/calendar.js in rsence-pre-2.2.0.5 vs js/datetime/calendar/calendar.js in rsence-pre-2.2.0.7

- old
+ new

@@ -12,13 +12,21 @@ ** since or before epoch (1970-01-01 00:00:00 UTC). ***/ var//RSence.DateTime HCalendar = HControl.extend({ componentName: 'calendar', - weekdays_localized: ['Wk','Mon','Tue','Wed','Thu','Fri','Sat','Sun'], + weekdaysLocalized: function(){ + var + _localeStrings = HLocale.dateTime.strings, + _outputArray = COMM.Values.clone( _localeStrings.weekDaysShort ); + _outputArray.push( _outputArray.shift() ); + _outputArray.unshift( _localeStrings.weekShort ); + return _outputArray; + },//['Wk','Mon','Tue','Wed','Thu','Fri','Sat','Sun'], defaultEvents: { - mouseWheel: true + mouseWheel: true, + click: true }, /** = Description * Calls HCalendar#nextMonth or HCalendar#prevMonth based on delta * of mouseWheel. * @@ -31,18 +39,24 @@ this.prevMonth(); } }, /** = Description + * Simple clickthrouct + click: function(){ + return false; + }, + +/** = Description * Refreshes weekdays. * **/ refreshLabel: function(){ if(!this['markupElemIds']){ return; } - var _weekdays_localized = this.weekdays_localized, + var _weekdays_localized = this.weekdaysLocalized(), _weekdays_width = Math.floor(this.rect.width/_weekdays_localized.length), _weekdays_html = [], i = 0, _weekdays_html_pre = ['<div style="width:'+_weekdays_width+'px;left:','px">'], _weekdays_html_suf = '</div>'; @@ -130,10 +144,10 @@ var _calendarDateRange = this.calendarDateRange(_date), _monthFirst = this.firstDateOfMonth(_date), _monthLast = this.lastDateOfMonth(_date), _firstDate = _calendarDateRange[0], _lastDate = _calendarDateRange[1], - _column_count = this.weekdays_localized.length, + _column_count = this.weekdaysLocalized().length, _column_width = Math.floor((this.rect.width-1)/_column_count), _row_height = Math.floor((this.rect.height-1-35)/6), _week_html_pre = ['<div class="calendar_weeks_week_row" style="width:'+(this.rect.width-3)+'px;height:'+_row_height+'px;top:','px">'], _week_html_suf = '</div>', _col_html_pre = ['<a href="javascript:void(HSystem.views['+this.viewId+'].setValue(','));" class="calendar_weeks_week_col','" style="width:'+_column_width+'px;height:'+_row_height+'px;line-height:'+_row_height+'px;left:','px">'],