Skip to content

this.parse() is undefined #26

@dim882

Description

@dim882

I'm attempting to use moment.js for date validations, and I have a validation rule that's pretty much the same as the XDate example in the documentation:

    birthdate: {
      date: {
        latest: moment().subtract(18, 'years'),
        message: "^You need to be at least 18 years old"
      }
    },

but I get an "Uncaught TypeError: undefined is not a function validate.js:622". It appears it's attempting to call #parse where this is the validators object, not the datetime object, so it fails. I wonder if it's possible I'm calling validate() wrong and screwing up the context, but I can't find anything in my code that would cause that.

Anyway, I'll submit a pull request soon with a fix that works for me, but let me know if this is incorrect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions