4
I have a system where I own a <input type="date">
and need to filter it, to bring on the calendar only the dates of 3 months ago and the current month
I was using the attributes min
and max
for testing, as they are fixed values, and worked:
<input type="date" name="dateIni" min="2013-12-01" max="local">
However, I need to change it manually every time I turn the month. How to automate this?
The question is unclear to me. You mean an input type date with calendar (HTML5) and you want to limit the possible choice of dates to max 3 months before the current day?
– Sergio
What is the calendar plugin you’re using? Post an example of code to help! xD
– Kenny Rafael
That. Follow the example. Date: <input type="date" name="dateIni" min="2013-12-01" max="local">
– Haone Nakano
Just to be clear, you want when loading the page the
min
be set todata_atual - 3 meses
?– Guilherme Bernal
Yes and max the date today.
– Haone Nakano
I did an update to the code. Was that the function you wanted? Works for me in Chrome.
– Sergio