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

Create datecomparison.js #1320

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SakhriHoussem
Copy link
Contributor

Create date comparison validator

I find a problem when I use parsley.js to compare between two inputs with type month or date

<input type="month" id="from" name="from">

or

<input type="date" id="from" name="from">

the problem is that parsley.js compares just between years but it doesn't take into consideration days or months when it compares

for example :

I want to make sure that the date in the input from must be near than the input to

<input type="month" id="from" name="from">
<input type="month" id="to" name="to">

so I write these two functions to try to fix this problem

create date comparaison validator
@marcandre
Copy link
Collaborator

Hi! Thanks for the PR.

For the first time if my life, I don't have my computer with me, as I'm trekking the Annapurna circuit! I will be reunited with my laptop in about two weeks; I'll either look at this on a plane or when I'm back home in early December...

I don't recall anything about type=month, so I'm also wondering if Parsley couldn't deal with this better, without the need of an extra validator...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants