summaryrefslogtreecommitdiffstats
path: root/user_guide_src/source/helpers
diff options
context:
space:
mode:
authorRoger Herbert <rogerlherbert@gmail.com>2012-03-12 13:46:02 +0100
committerRoger Herbert <rogerlherbert@gmail.com>2012-03-12 13:46:02 +0100
commitb81f909f8aaa3bedc3820c0d4c9056b57113b46e (patch)
treef09ba1ce7a45eb599a9bdcc677b5c5bf825299b2 /user_guide_src/source/helpers
parentb8fb66b38e233c82f0116f9bdb0fdfd4ee074b30 (diff)
updated docs & changelog
Diffstat (limited to 'user_guide_src/source/helpers')
-rw-r--r--user_guide_src/source/helpers/date_helper.rst13
1 files changed, 8 insertions, 5 deletions
diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst
index ad06dd628..b21d147bd 100644
--- a/user_guide_src/source/helpers/date_helper.rst
+++ b/user_guide_src/source/helpers/date_helper.rst
@@ -255,14 +255,16 @@ Formats a unix timestamp so that is appears similar to this
The first parameter must contain a Unix timestamp. The second parameter
must contain a timestamp that is greater that the first timestamp. If
-the second parameter empty, the current time will be used. The most
-common purpose for this function is to show how much time has elapsed
-from some point in time in the past to now.
+the second parameter empty, the current time will be used. The third
+parameter is optional and limits the number of time units to display.
+The most common purpose for this function is to show how much time has
+elapsed from some point in time in the past to now.
-.. php:method:: timespan($seconds = 1, $time = '')
+.. php:method:: timespan($seconds = 1, $time = '', $units = '')
:param integer $seconds: a number of seconds
:param string $time: Unix timestamp
+ :param integer $units: a number of time units to display
:returns: string
Example
@@ -271,7 +273,8 @@ Example
$post_date = '1079621429';
$now = time();
- echo timespan($post_date, $now);
+ $units = 2;
+ echo timespan($post_date, $now, $units);
.. note:: The text generated by this function is found in the following language
file: language/<your_lang>/date_lang.php