added prevYear,nextYear methods/buttons

This commit is contained in:
Adam Shaw 2009-10-12 07:01:26 +00:00
parent 13f7d167b3
commit 9db94207cb
3 changed files with 18 additions and 0 deletions

View file

@ -117,6 +117,11 @@ table.fc-header {
padding: 4px 6px; padding: 4px 6px;
} }
.fc-header .fc-state-default span,
.fc-header .ui-state-default span {
white-space: nowrap;
}
/* for adjacent buttons */ /* for adjacent buttons */
.fc-header .fc-no-right { .fc-header .fc-no-right {

View file

@ -54,6 +54,8 @@ var defaults = {
buttonText: { buttonText: {
prev: ' ◄ ', prev: ' ◄ ',
next: ' ► ', next: ' ► ',
prevYear: 'prev year',
nextYear: 'next year',
today: 'today', today: 'today',
month: 'month', month: 'month',
week: 'week', week: 'week',
@ -367,6 +369,16 @@ $.fn.fullCalendar = function(options) {
render(1); render(1);
}, },
prevYear: function() {
addYears(date, -1);
render();
},
nextYear: function() {
addYears(date, 1);
render();
},
today: function() { today: function() {
date = new Date(); date = new Date();
render(); render();

View file

@ -13,6 +13,7 @@
$('#calendar').fullCalendar({ $('#calendar').fullCalendar({
header: { header: {
left: 'prevYear,prev,next,nextYear today',
right: 'month,agendaWeek,basicWeek,agendaDay,basicDay' right: 'month,agendaWeek,basicWeek,agendaDay,basicDay'
}, },
editable: true, editable: true,