Merge remote-tracking branch 'sergio-fry/master'
commit
75abd3f0cc
18
README.mkd
18
README.mkd
|
@ -45,3 +45,21 @@ Here is an example of doing it within an element having an `id` of `calendar`:
|
||||||
});
|
});
|
||||||
|
|
||||||
To see a full list of all available options, please consult the [FullCalendar documentation »](http://arshaw.com/fullcalendar/docs/)
|
To see a full list of all available options, please consult the [FullCalendar documentation »](http://arshaw.com/fullcalendar/docs/)
|
||||||
|
|
||||||
|
I18n
|
||||||
|
----
|
||||||
|
To localize fullCalendar You can use i18n for jquery datepicker.
|
||||||
|
|
||||||
|
$.fullCalendar.applyLocale($.datepicker.regional['ru']);
|
||||||
|
|
||||||
|
Other texts could be modified via method setDefaults:
|
||||||
|
|
||||||
|
$.fullCalendar.setDefaults({
|
||||||
|
buttonText: {
|
||||||
|
month: 'month',
|
||||||
|
week: 'week',
|
||||||
|
day: 'day'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
See all available locales here: [I18n](https://github.com/sergio-fry/fullcalendar/wiki/I18n)
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
var applyLocale = function(locale) {
|
||||||
|
setDefaults({
|
||||||
|
isRTL: locale.isRTL,
|
||||||
|
firstDay: locale.firstDay,
|
||||||
|
monthNames: locale.monthNames,
|
||||||
|
monthNamesShort: locale.monthNamesShort,
|
||||||
|
dayNames: locale.dayNames,
|
||||||
|
dayNamesShort: locale.dayNamesShort,
|
||||||
|
buttonText: {
|
||||||
|
today: locale.currentText
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fullCalendar.applyLocale = function(locale) {
|
||||||
|
applyLocale(locale);
|
||||||
|
}
|
|
@ -44,6 +44,7 @@ js('Header.js');
|
||||||
js('EventManager.js');
|
js('EventManager.js');
|
||||||
js('date_util.js');
|
js('date_util.js');
|
||||||
js('util.js');
|
js('util.js');
|
||||||
|
js('I18n.js');
|
||||||
|
|
||||||
js('basic/MonthView.js');
|
js('basic/MonthView.js');
|
||||||
js('basic/FourWeeksView.js');
|
js('basic/FourWeeksView.js');
|
||||||
|
|
15
src/main.js
15
src/main.js
|
@ -36,31 +36,32 @@ $.fn.fullCalendar = function(options) {
|
||||||
eventSources.push(options.events);
|
eventSources.push(options.events);
|
||||||
delete options.events;
|
delete options.events;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
options = $.extend(true, {},
|
options = $.extend(true, {},
|
||||||
defaults,
|
defaults,
|
||||||
(options.isRTL || options.isRTL===undefined && defaults.isRTL) ? rtlDefaults : {},
|
(options.isRTL || options.isRTL===undefined && defaults.isRTL) ? rtlDefaults : {},
|
||||||
options
|
options
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
this.each(function(i, _element) {
|
this.each(function(i, _element) {
|
||||||
var element = $(_element);
|
var element = $(_element);
|
||||||
var calendar = new Calendar(element, options, eventSources);
|
var calendar = new Calendar(element, options, eventSources);
|
||||||
element.data('fullCalendar', calendar); // TODO: look into memory leak implications
|
element.data('fullCalendar', calendar); // TODO: look into memory leak implications
|
||||||
calendar.render();
|
calendar.render();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// function for adding/overriding defaults
|
// function for adding/overriding defaults
|
||||||
function setDefaults(d) {
|
var setDefaults = function(d) {
|
||||||
$.extend(true, defaults, d);
|
$.extend(true, defaults, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$.fullCalendar.setDefaults = setDefaults;
|
||||||
|
|
Loading…
Reference in New Issue