From d9c3a6f20e858b22ababbb2a3f3209eca1e93c13 Mon Sep 17 00:00:00 2001 From: Kyle Farris Date: Sun, 21 Aug 2011 23:08:17 -0300 Subject: Added documentation for some other rule someone added but didn't document. --- user_guide/libraries/form_validation.html | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'user_guide') diff --git a/user_guide/libraries/form_validation.html b/user_guide/libraries/form_validation.html index 7c544b69f..4400bac83 100644 --- a/user_guide/libraries/form_validation.html +++ b/user_guide/libraries/form_validation.html @@ -1037,6 +1037,13 @@ POST array:

  + + is_unique + Yes + Returns FALSE if the form element is not unique in a database table. + is_unique[table.field] + + valid_email No -- cgit v1.2.3-24-g4f1b From 37e5ff65b2bd1601daadac40fdfce80fd8956fd7 Mon Sep 17 00:00:00 2001 From: Kyle Farris Date: Sun, 21 Aug 2011 23:21:25 -0300 Subject: Added documentation for the nice_date function in the date_helper. --- user_guide/helpers/date_helper.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'user_guide') 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); +

nice_date()

+ +

This function can take a number poorly-formed date formats and convert them into something useful. It also accepts well-formed dates.

+

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:

+ +$bad_time = 199605
+
+// Should Produce: 1996-05-01
+$better_time = nice_date($bad_time,'Y-m-d');
+
+$bad_time = 9-11-2001
+// Should Produce: 2001-09-11
+$better_time = nice_date($human,'Y-m-d');
+

timespan()

-- cgit v1.2.3-24-g4f1b