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 after/before validation rules don't appear to be working. #39

Closed
haakym opened this issue Aug 3, 2015 · 4 comments
Closed

Date after/before validation rules don't appear to be working. #39

haakym opened this issue Aug 3, 2015 · 4 comments
Labels
Milestone

Comments

@haakym
Copy link

haakym commented Aug 3, 2015

Here are my rules:

public function rules()
{
    return [
        'date_start' => 'date|date_format:d-m-Y|before:date_finish',
        'date_finish' => 'date|date_format:d-m-Y|after:date_start',
    ];
}

Outcomes from varying input:

  1. Expected

Input
date_start: 10-10-2015
date_finish: 10-10-2016

Messages
date_start: "The date start must be a date before date finish."
date_finish: Nothing

  1. Erroneous

Input
date_start: 10-10-2017
date_finish: 10-10-2016

Messages
date_start: "The date start must be a date before date finish."
date_finish: Nothing

  1. Same

Input
date_start: 10-10-2016
date_finish: 10-10-2016

Messages
date_start: "The date start must be a date before date finish."
date_finish: Nothing

Please note I've tried with my rules like this

public function rules()
{
    return [
        'date_start' => 'before:date_finish',
        'date_finish' => 'after:date_start',
    ];
}

and this

public function rules()
{
    return [
        'date_start' => 'date|date_format:Y-m-d|before:date_finish',
        'date_finish' => 'date|date_format:Y-m-d|after:date_start',
    ];
}

Any guidance if I'm doing something wrong would be most appreciated! Excellent package btw, big thanks to the creator.

@torrentalle
Copy link
Member

This bug is fixed in master branch

@thanosalexander
Copy link

any fix here? it seems not working

@bytestream
Copy link
Collaborator

@thanosalexander please open a new issue.

@thanosalexander
Copy link

ok @bytestream

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

4 participants