Add documentation for date_format validation rule.

This commit is contained in:
Franz Liedke
2012-09-07 14:03:23 +02:00
parent a40aabbb05
commit e407e67559

View File

@@ -196,14 +196,22 @@ Many times, when updating a record, you want to use the unique rule, but exclude
#### Validate that a date attribute is before a given date:
'birthdate' => 'before:1986-28-05';
'birthdate' => 'before:1986-28-05',
#### Validate that a date attribute is after a given date:
'birthdate' => 'after:1986-28-05';
'birthdate' => 'after:1986-28-05',
> **Note:** The **before** and **after** validation rules use the **strtotime** PHP function to convert your date to something the rule can understand.
#### Validate that a date attribute conforms to a given format:
'start_date' => 'date_format:H\\:i'),
> **Note:** The backslash escapes the colon so that it does not count as a parameter separator.
The formatting options for the date format are described in the [PHP documentation](http://php.net/manual/en/datetime.createfromformat.php#refsect1-datetime.createfromformat-parameters).
<a name="rule-email"></a>
### E-Mail Addresses