i18n via $.datepicker
This commit is contained in:
parent
7fc1e166c5
commit
f87648f7d4
4 changed files with 37 additions and 7 deletions
|
@ -45,3 +45,11 @@ 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']);
|
||||||
|
|
||||||
|
|
||||||
|
|
18
src/I18n.js
Normal file
18
src/I18n.js
Normal file
|
@ -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/BasicWeekView.js');
|
js('basic/BasicWeekView.js');
|
||||||
|
|
|
@ -59,8 +59,11 @@ $.fn.fullCalendar = function(options) {
|
||||||
|
|
||||||
|
|
||||||
// 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 = function(d) {
|
||||||
|
setDefaults(d);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue