diff options
author | Greg Aker <greg@gregaker.net> | 2011-08-21 23:30:40 +0200 |
---|---|---|
committer | Greg Aker <greg@gregaker.net> | 2011-08-21 23:30:40 +0200 |
commit | 597aff7b9358135ca2566164541267650466b693 (patch) | |
tree | 2d19b96df9871fe1bc908bd4025dabfcc5cb50ca /user_guide | |
parent | 297eb2fa755d8d0202511d4181dc4dab115e842c (diff) | |
parent | 37e5ff65b2bd1601daadac40fdfce80fd8956fd7 (diff) |
Merge pull request #255 from kylefarris/master
New Date Helper Function and More Documentation
Diffstat (limited to 'user_guide')
-rw-r--r-- | user_guide/helpers/date_helper.html | 14 | ||||
-rw-r--r-- | user_guide/libraries/form_validation.html | 7 |
2 files changed, 21 insertions, 0 deletions
diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index f930ea3ae..29e242696 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -234,6 +234,20 @@ $unix = human_to_unix($human);</code> +<h2>nice_date()</h2> + +<p>This function can take a number poorly-formed date formats and convert them into something useful. It also accepts well-formed dates.</p> +<p>The fuction will return a Unix timestamp by default. You can, optionally, pass a format string (the same type as the PHP date function accepts) as the second parameter. Example:</p> + +<code>$bad_time = 199605<br /> +<br /> +// Should Produce: 1996-05-01<br /> +$better_time = nice_date($bad_time,'Y-m-d');<br /> +<br /> +$bad_time = 9-11-2001<br /> +// Should Produce: 2001-09-11<br /> +$better_time = nice_date($human,'Y-m-d');</code> + <h2>timespan()</h2> diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index d9d8a4502..ede1913e0 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -1042,6 +1042,13 @@ POST array:</p> </tr> <tr> + <td class="td"><strong>is_unique</strong></td> + <td class="td">Yes</td> + <td class="td">Returns FALSE if the form element is not unique in a database table.</td> + <td class="td">is_unique[table.field]</td> + </tr> + + <tr> <td class="td"><strong>valid_email</strong></td> <td class="td">No</td> <td class="td">Returns FALSE if the form element does not contain a valid email address.</td> |