diff --git a/Makefile b/Makefile
index 013e141..722b346 100644
--- a/Makefile
+++ b/Makefile
@@ -20,13 +20,14 @@ zip:
then cp build/fullcalendar.min.js build/fullcalendar-${VER}/fullcalendar;\
else echo "\n!!! WARNING: fullcalendar.js not yet minified.\n";\
fi
- @rm -rf `find build -type d -name .svn`
+ @rm -rf `find build/fullcalendar-* -type d -name .svn`
@for f in build/fullcalendar-${VER}/fullcalendar/*.js; do\
sed -i "s/* FullCalendar/& v${VER}/" $$f;\
sed -i "s/* Date:/& ${DATE}/" $$f;\
sed -i "s/* Revision:/& ${REV}/" $$f;\
done
@cd build; zip -r fullcalendar-${VVER}.zip fullcalendar-${VVER}
+ @mkdir -p dist
@mv build/fullcalendar-${VER}.zip dist
@rm -rf build/fullcalendar-${VER}
@rm -f build/fullcalendar.min.js
diff --git a/changelog.txt b/changelog.txt
index b8197f2..b369c73 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -8,6 +8,7 @@ version 1.2 (5/31/09)
- better date formatting ($.fullCalendar.formatDate)
- multiple 'event sources' allowed
- dynamically add/remove event sources
+ - options for prevYear and nextYear buttons
- docs have been reworked (include addition of Google Calendar docs)
- changed behavior of parseDate for number strings
(now interpets as unix timestamp, not MS times)
@@ -17,9 +18,13 @@ version 1.2 (5/31/09)
- events from previous months sticking when clicking prev/next quickly
- Google Calendar API changed to work w/ multiple event sources
- can also provide 'className' and 'draggable' options
- - date utilties moved from $ properties to $.fullCalendar
+ - date utilties moved from $ to $.fullCalendar
+ - more documentation in source code
- minified version of fullcalendar.js
- test suit (available from svn)
+ - top buttons now use w/ an inner for better css cusomization
+ - thus CSS has changed. IF UPGRADING FROM PREVIOUS VERSIONS,
+ UPGRADE YOUR FULLCALENDAR.CSS FILE!!!
version 1.1 (5/10/09)
- Added the following options:
diff --git a/docs/index.txt b/docs/index.txt
index bd0e0d1..d842397 100644
--- a/docs/index.txt
+++ b/docs/index.txt
@@ -45,11 +45,25 @@ General Options
list of commands.
**buttons**: boolean/hash, default:``true``
- Determines whether navigation buttons will be displayed at the top of the
- calendar. A hash such as ``{today:false, prev:true, next:true}`` can be
- provided to display only certain buttons. A hash such as
- ``{today:false, prev:"Last Month", next:"Next Month"}`` can be provided
- to display only certain buttons AND change a button's text.
+ ``true`` will display a previous-month, next-month, and "today" button.
+ The "today" button will only be visible for months other than the current.
+
+ ``false`` will display absolutely no buttons.
+
+ An object hash can be provided to display only *certain* buttons. The hash
+ can have the following properties::
+
+ {
+ today: bool/string,
+ prevYear: bool/string,
+ prevMonth: bool/string,
+ nextMonth: bool/string,
+ nextYear: bool/string
+ }
+
+ A value of ``false`` will not display the button. A value of ``true`` will
+ display the button with some default text. A *string* value will display
+ the button *and* customize its text.
**showTime**: boolean/ ``"guess"``, default:``"guess"``
Determines if times will be displayed before each event's title.
@@ -308,9 +322,15 @@ initialized:
**.fullCalendar(** ``'gotoMonth'``, **year, month)**
Visits an arbitrary month. ``month`` is zero-based (0 is January, 1 is
February, etc).
-
+
**.fullCalendar(** ``'today'`` **)**
Visits the current month.
+
+ **.fullCalendar(** ``'prevYear'`` **)**
+ Moves one year back.
+
+ **.fullCalendar(** ``'nextYear'`` **)**
+ Moves one year ahead.
**.fullCalendar(** ``'refresh'`` **)**
Refetch and redraw the events for the current month.
diff --git a/fullcalendar/fullcalendar.css b/fullcalendar/fullcalendar.css
index 3fb5720..19bb0b0 100644
--- a/fullcalendar/fullcalendar.css
+++ b/fullcalendar/fullcalendar.css
@@ -10,17 +10,24 @@
margin: 0 0 1em;
}
-.full-calendar-buttons input {
+.full-calendar-buttons button {
vertical-align: middle;
margin: 0 0 0 5px;
font-size: 1em;
}
-.full-calendar-prev,
-.full-calendar-next {
- width: 40px;
+.full-calendar-buttons button span {
+ padding: 0 10px;
}
+ /* To always display the "today" button:
+ *
+ * .full-calendar-buttons button.today {
+ * visibility: visible !important;
+ * }
+ */
+
+
/* table layout & outer border */
@@ -42,14 +49,15 @@
+
/* cell styling */
.full-calendar-month th,
.full-calendar-month td.day {
padding: 0;
vertical-align: top;
- border-style: solid; /* inner border style */
- border-color: #ccc; /* inner border color */
+ border-style: solid; /* inner border style */
+ border-color: #ccc; /* inner border color */
border-width: 1px 0 0 1px;
}
@@ -80,10 +88,14 @@
padding: 2px 2px 0; /* distance between events and day edges */
}
-.full-calendar-month td.day {
- /* FullCalendar automatically chooses a height, but this can be overridden: */
- /* height: 100px !important; */
- }
+ /* FullCalendar automatically chooses a cell's height,
+ * but this can be overridden:
+ *
+ * .full-calendar-month td.day {
+ * height: 100px !important;
+ * }
+ */
+
@@ -142,11 +154,12 @@
.full-calendar-month .over-day {
background: #ADDBFF;
opacity: .2;
- filter: alpha(opacity=20);
+ filter: alpha(opacity=20); /* for IE */
}
+
/* right-to-left support */
.r2l .full-calendar-title {
@@ -157,7 +170,7 @@
float: left;
}
-.r2l .full-calendar-buttons input {
+.r2l .full-calendar-buttons button {
margin: 0 5px 0 0;
}
diff --git a/fullcalendar/fullcalendar.js b/fullcalendar/fullcalendar.js
index 8511349..8c78684 100644
--- a/fullcalendar/fullcalendar.js
+++ b/fullcalendar/fullcalendar.js
@@ -121,6 +121,16 @@
refreshMonth();
}
+ function prevYear() {
+ addYears(date, -1);
+ refreshMonth();
+ }
+
+ function nextYear() {
+ addYears(date, 1);
+ refreshMonth();
+ }
+
//
@@ -133,6 +143,8 @@
nextMonth: nextMonth,
today: gotoToday,
gotoMonth: gotoMonth,
+ prevYear: prevYear,
+ nextYear: nextYear,
//
@@ -276,31 +288,53 @@
if (bo) { // "button options"
var buttons = $("
").appendTo(header);
- var prevButton, nextButton;
- if (bo == true || bo.today != false) {
- todayButton = $(" ")
+ if (bo == true || bo.today !== false) {
+ todayButton = $(" ")
+ .append($(" ").html(
+ typeof bo.today == 'string' ?
+ bo.today : "today"))
.click(gotoToday);
- if (typeof bo.today == 'string') todayButton.val(bo.today);
buttons.append(todayButton);
}
- if (bo == true || bo.prev != false) {
- prevButton = $(" ")
- .click(prevMonth);
- if (typeof bo.prev == 'string') prevButton.val(bo.prev);
- if (r2l) buttons.prepend(prevButton);
- else buttons.append(prevButton);
+ if (bo.prevYear) {
+ var b = $(" ")
+ .append($(" ")
+ .html(typeof bo.prevYear == 'string' ?
+ bo.prevYear : "«"))
+ .click(prevYear);
+ if (r2l) buttons.prepend(b);
+ else buttons.append(b);
}
- if (bo == true || bo.next != false) {
- nextButton = $(" ")
+ if (bo == true || bo.prevMonth !== false) {
+ var b = $(" ")
+ .append($(" ")
+ .html(typeof bo.prevMonth == 'string' ?
+ bo.prevMonth : (r2l ? ">" : "<")))
+ .click(prevMonth);
+ if (r2l) buttons.prepend(b);
+ else buttons.append(b);
+ }
+ if (bo == true || bo.nextMonth !== false) {
+ var b = $(" ")
+ .append($(" ").html(typeof bo.nextMonth == 'string' ?
+ bo.nextMonth : (r2l ? "<" : ">")))
.click(nextMonth);
- if (typeof bo.next == 'string') nextButton.val(bo.next);
- if (r2l) buttons.prepend(nextButton);
- else buttons.append(nextButton);
+ if (r2l) buttons.prepend(b);
+ else buttons.append(b);
+ }
+ if (bo.nextYear) {
+ var b = $(" ")
+ .append($(" ").html(typeof bo.nextYear == 'string'
+ ? bo.nextYear : "»"))
+ .click(nextYear);
+ if (r2l) buttons.prepend(b);
+ else buttons.append(b);
}
}
- if (options.title !== false)
+ if (options.title !== false) {
titleElement = $(" ").appendTo(header);
+ }
monthElement = $("
")
.appendTo($("
").appendTo(this));
@@ -1082,6 +1116,12 @@
return clearTime(d);
}
+ function addYears(d, n, keepTime) {
+ d.setFullYear(d.getFullYear() + n);
+ if (keepTime) return d;
+ return clearTime(d);
+ }
+
function addDays(d, n, keepTime) {
d.setDate(d.getDate() + n);
if (keepTime) return d;
diff --git a/test/locale.html b/test/locale.html
index 6b26882..71bf8bc 100644
--- a/test/locale.html
+++ b/test/locale.html
@@ -27,7 +27,7 @@ $(document).ready(function() {
weekStart: 1,
- rightToLeft: true,
+ //rightToLeft: true,
events: [
{
diff --git a/test/methods.html b/test/methods.html
index 990d851..70d427e 100644
--- a/test/methods.html
+++ b/test/methods.html
@@ -101,6 +101,8 @@ function removeTestEvents(therepeating) {
today
prev
next
+prevyear
+nextyear
June 1986
diff --git a/test/options.html b/test/options.html
index 06a75af..2024aa0 100644
--- a/test/options.html
+++ b/test/options.html
@@ -26,7 +26,7 @@ $(document).ready(function() {
draggable: true,
- fixedWeeks: false,
+ fixedWeeks: true,
abbrevDayHeadings: false,
@@ -34,10 +34,14 @@ $(document).ready(function() {
titleFormat: 'm/Y', //'n/Y', //'M y',
//buttons: false,
- buttons: { today:false, prev:"prev", next:"next" },
+ //buttons: { today:false },
+ //buttons: { today:false, prevMonth:"prev", nextMonth:"next" },
+ //buttons: { today:true, prevMonth:false, nextMonth:"next" },
+ //buttons: { prevYear:true, nextYear:true },
+ //buttons: { today:true, prevYear:"py", prevMonth:true, nextMonth:true, nextYear:"ny" },
showTime: true,
- timeFormat: 'H:i', //'ha', //'GA', //'gX',
+ timeFormat: 'ha', //'H:i', //'GA', //'gX',
eventDragOpacity: .5,
eventRevertDuration: 2000,
diff --git a/test/sources.html b/test/sources.html
index c85992b..2d11848 100644
--- a/test/sources.html
+++ b/test/sources.html
@@ -15,10 +15,18 @@
}
+
+
+
+