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

presence validator against date attribute will complain even it's not empty #48

Closed
yunjia opened this Issue Apr 15, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@yunjia
Copy link

yunjia commented Apr 15, 2015

Following is a quick test case:

var validate = require("validate.js");

describe("validate", function ()
{
    describe("should give correct error for presence validator", function ()
    {
        it("when validating against date", function ()
        {
            var obj = {date: new Date()}, constrain = {date: {presence: true}};

            expect(validate(obj, constrain)).toBe(undefined);
        });
    });
});

@yunjia yunjia changed the title presence validator agains date attribute will complain even there is a date presence validator against date attribute will complain even it's not empty Apr 15, 2015

@ansman

This comment has been minimized.

Copy link
Owner

ansman commented Apr 16, 2015

Nice find! I'll release a patch today.

@ansman

This comment has been minimized.

Copy link
Owner

ansman commented Apr 16, 2015

Fixed in 0.7.1

@ansman ansman closed this Apr 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment