summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos SF Filho <sffmarcos142009z@gmail.com>2014-01-09 12:20:55 +0100
committerMarcos SF Filho <sffmarcos142009z@gmail.com>2014-01-09 12:20:55 +0100
commit2e914b7dc6acaf2938fac4c332ff682a033b93d7 (patch)
tree133784bbea11ba56e75fafa7123d2ff8fc756e55
parent0cd7c92ee59b4b03588e45229944d4b83eea3d8e (diff)
Updates for the Calendar Pull Request
-rw-r--r--system/libraries/Calendar.php2
-rw-r--r--user_guide_src/source/libraries/calendar.rst28
2 files changed, 15 insertions, 15 deletions
diff --git a/system/libraries/Calendar.php b/system/libraries/Calendar.php
index de77e3d7f..711d23bec 100644
--- a/system/libraries/Calendar.php
+++ b/system/libraries/Calendar.php
@@ -302,7 +302,7 @@ class CI_Calendar {
if ($day <= 0)
{
// Day of previous month
- $prev_month = $this->adjust_date(((int) $month) - 1, $year);
+ $prev_month = $this->adjust_date($month - 1, $year);
$prev_month_days = $this->get_total_days($prev_month['month'], $prev_month['year']);
$out .= str_replace('{day}', $prev_month_days + $day, $this->temp['cal_cell_other']);
}
diff --git a/user_guide_src/source/libraries/calendar.rst b/user_guide_src/source/libraries/calendar.rst
index 8b2f503b9..e24ee80b8 100644
--- a/user_guide_src/source/libraries/calendar.rst
+++ b/user_guide_src/source/libraries/calendar.rst
@@ -86,23 +86,23 @@ The above code would start the calendar on saturday, use the "long"
month heading, and the "short" day names. More information regarding
preferences below.
-====================== ============== =============================================== ===================================================================
-Preference Default Options Description
-====================== ============== =============================================== ===================================================================
-**template** None None A string containing your calendar template.
+====================== ================= =============================================== ===================================================================
+Preference Default Options Description
+====================== ================= =============================================== ===================================================================
+**template** None None A string containing your calendar template.
See the template section below.
-**local_time** time() None A Unix timestamp corresponding to the current time.
-**start_day** sunday Any week day (sunday, monday, tuesday, etc.) Sets the day of the week the calendar should start on.
-**month_type** long long, short Determines what version of the month name to use in the header.
+**local_time** time() None A Unix timestamp corresponding to the current time.
+**start_day** sunday Any week day (sunday, monday, tuesday, etc.) Sets the day of the week the calendar should start on.
+**month_type** long long, short Determines what version of the month name to use in the header.
long = January, short = Jan.
-**day_type** abr long, short, abr Determines what version of the weekday names to use in
+**day_type** abr long, short, abr Determines what version of the weekday names to use in
the column headers. long = Sunday, short = Sun, abr = Su.
-**show_next_prev** FALSE TRUE/FALSE (boolean) Determines whether to display links allowing you to toggle
+**show_next_prev** FALSE TRUE/FALSE (boolean) Determines whether to display links allowing you to toggle
to next/previous months. See information on this feature below.
-**next_prev_url** Controller URL A URL Sets the basepath used in the next/previous calendar links.
-**show_other_days** FALSE TRUE/FALSE (boolean) Determines whether to display days of other months that shares the
+**next_prev_url** controller/method A URL Sets the basepath used in the next/previous calendar links.
+**show_other_days** FALSE TRUE/FALSE (boolean) Determines whether to display days of other months that share the
first or last week of the calendar month.
-====================== ============== =============================================== ===================================================================
+====================== ================= =============================================== ===================================================================
Showing Next/Previous Month Links
@@ -125,8 +125,8 @@ You'll notice a few things about the above example:
- You must set the "show_next_prev" to TRUE.
- You must supply the URL to the controller containing your calendar in
- the "next_prev_url" preference. The Code Igniter will try to guess
- the link for the current controller/method if you don't supply.
+ the "next_prev_url" preference. If you don't, it will be set to the current
+ *controller/method*.
- You must supply the "year" and "month" to the calendar generating
function via the URI segments where they appear (Note: The calendar
class automatically adds the year/month to the base URL you