summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-01-11 22:58:50 +0100
committerAndrey Andreev <narf@bofh.bg>2012-01-11 22:58:50 +0100
commit2139ecdbe882dee32f60de5aec74ec2b8a509b7a (patch)
tree67e2878e6901932e27bfd6f24cebb424d15e56a3 /user_guide_src/source
parent1e42cdc1d3b4c919e0e4dec6a2ce81c360e946af (diff)
Added date_range() to the Date helper
Diffstat (limited to 'user_guide_src/source')
-rw-r--r--user_guide_src/source/changelog.rst3
-rw-r--r--user_guide_src/source/helpers/date_helper.rst24
2 files changed, 26 insertions, 1 deletions
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 48011f208..613ef7881 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -38,7 +38,8 @@ Release Date: Not Released
- url_title() will now trim extra dashes from beginning and end.
- Added XHTML Basic 1.1 doctype to :doc:`HTML Helper <helpers/html_helper>`.
- - Changed humanize to include a second param for the separator.
+ - Changed humanize() to include a second param for the separator.
+ - Added date_range() to the :doc:`Date Helper <helpers/html_helper>`.
- Database
diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst
index ad06dd628..f965e6166 100644
--- a/user_guide_src/source/helpers/date_helper.rst
+++ b/user_guide_src/source/helpers/date_helper.rst
@@ -296,6 +296,30 @@ Example
If the second parameter is empty, the current year will be used.
+date_range()
+============
+
+Returns a list of dates within a specified period.
+
+.. php:method:: date_range($unix_start = '', $mixed = '', $is_unix = TRUE, $format = 'Y-m-d')
+
+ :param integer $unix_start: UNIX timestamp of the range start date
+ :param integer $mixed: UNIX timestamp of the range end date or interval in days
+ :param boolean $is_unix: set to FALSE if $mixed is not a timestamp
+ :param string $format: output date format, same as in date()
+ :returns: array
+
+Example
+
+::
+
+ $range = date_range('2012-01-01', '2012-01-15');
+ echo "First 15 days of 2012:";
+ foreach ($range as $date)
+ {
+ echo $date."\n";
+ }
+
timezones()
===========