summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAsko Nomm <asko@bien.ee>2022-03-06 22:48:02 +0100
committerAsko Nomm <asko@bien.ee>2022-03-06 22:48:02 +0100
commitf313168d4b53b32b1ee3ce3e2e9ed749848f6985 (patch)
treedc55fed561e6d09ae8a9cd41e4f313d969abd36f /README.md
parent49a2e23470c291004f2fb203401408225fb61831 (diff)
(MINOR) Implement DateFormatValidator
Diffstat (limited to 'README.md')
-rw-r--r--README.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index 0be14fa..d60b44b 100644
--- a/README.md
+++ b/README.md
@@ -88,6 +88,18 @@ $rules = ['password' => 'required'];
$hird = new Hird($fields, $rules);
```
+### 'date-format`
+
+The `date-format` validator validates the string format of a date, and is registered as the `date-format` rule. It will pass validation if the value is set and the value is in the format specified by the rule.
+
+```php
+use Askonomm\Hird\Hird;
+
+$fields = ['date' => '2020-09-17'];
+$rules = ['date' => 'date-format:Y-m-d'];
+$hird = new Hird($fields, $rules);
+```
+
## Creating validators
You can also create your own validators, or replace existing ones if you're not happy with them.