Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date Rule #7

Open
bdbch opened this issue Aug 29, 2018 · 0 comments
Open

Date Rule #7

bdbch opened this issue Aug 29, 2018 · 0 comments
Labels

Comments

@bdbch
Copy link
Owner

bdbch commented Aug 29, 2018

Description

This rule should be able to check if an input is a date and (optionally) check if the date is between or later/earlier than other dates.

Example Code

[
  'date' => [
    [
      'rule' => 'date',
      'formats' => [ 'Y-m-d', 'd.m.Y' ],
      'message' => 'Please provide a real date'.
      'min' => [
        'date' => date('Y-m-d'),
        'message' => 'The selected date must be after today'
      ],
      'max' => [
        'date' => '2018-12-01',
        'message' => 'The selected date cant be next year'
      ]
    ]
  ]
]
@bdbch bdbch added the rules label Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant