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

Render of 'date' input is incorrect #40

Open
chippyash opened this issue May 15, 2018 · 3 comments
Open

Render of 'date' input is incorrect #40

chippyash opened this issue May 15, 2018 · 3 comments
Assignees

Comments

@chippyash
Copy link
Collaborator

chippyash commented May 15, 2018

The rendering of an <input type="date"/> is incorrect. You are over riding with three drop down selectors. This should be pulled out as browsers know how to render. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date

The problem is with the current solution is that it if your markup specifies an id for the field (not uncommon if you are using <label for.../>) ,the id is repeated for the day, month and year selectors.

Also, year is restricted to max of current year.

You'd almost be better to rely on jquery date, but that brings in a dependency you may not want.

So, suggest you a/ enable an option that allows no library rendering of date field and b/ appends .day, .month and .year to the id if present to prevent html syntax failures and c/ allow specification of min and max dates.

@Gregwar
Copy link
Owner

Gregwar commented May 15, 2018

What do you mean by "no library rendering" ? Avoiding the three dropdowns ?
I'm ok with the id change
I don't understand how the min and max would be handled, maybe with relative dates like min="-1year" or max="now" ? (handled with strtotime ?)

@chippyash
Copy link
Collaborator Author

'no library rendering' - switch off the Formidable library rendering of the date field, leaving it simply as <input type="date"/> in the html rendering.
id change: can be handled as separate issue/PR
min and max handling: yes, that needs some discussion. Can be handled as a separate issue/PR

@Gregwar
Copy link
Owner

Gregwar commented May 16, 2018

Yes ok, disabling the library rendering might be the default, don't you think ? Not sure how much this is currently supported

@chippyash chippyash self-assigned this May 16, 2018
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

No branches or pull requests

2 participants