Home › Forums › Quform WordPress › Datepicker Settings in Quform
- This topic has 6 replies, 2 voices, and was last updated 10 years, 4 months ago by
Ally.
- AuthorPosts
- April 19, 2015 at 11:29 pm #15047
smart367
ParticipantI have found the code to do what I want for the datepicker, but I’m not sure how to enable it for every or selected forms I use datepicker on, and where to put it.
I may have multiple datepickers on my pages can I have them all behave the same?
More specifically…
I am attempting to enable only specific dates within a month (1,8,16,23), in mm/dd/yyyy format, and disable any past dates from being displayed.I found the following code for the specific days:
$('.selector').datepicker({
beforeShowDay: function (date) {
//getDate() returns the day (0-31)
if (date.getDate() == 1 || date.getDate() == 8 || date.getDate() == 16 || date.getDate() == 23) {
return [true, ''];
}
return [false, ''];
}
});
I think the following line will solve the date format, although I know it’s not complete:
$('#datepicker').datepicker({dateFormat: ‘mm-dd-yyyy’ not sure what goes here! })
and then the code setting the minDate to today, hopefully disabling any past dates from being displayed:
$('#datePickerId').datepicker({minDate: '0'});
The past dates is not absolutely necessary but if I can incorporate it all, that would be nice.
As always, this forum rocks, love the plugin and all the support.
Thanks in advance, ScottApril 21, 2015 at 1:59 pm #15081Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
April 21, 2015 at 3:28 pm #15089smart367
ParticipantThat’s beautiful Ally!
I actually need every datepicker on the page / site to behave the same way but I can live with adding every instance I need it.
Again the forum is amazing, you deserve a raise!
Thanks again
- This reply was modified 10 years, 4 months ago by
smart367.
April 21, 2015 at 4:26 pm #15090smart367
ParticipantI just added additional lines for every datepicker I use in my pages, made all the popup calendars only show the intended dates… awesome! Is there a way to disable the inline part of the datepicker? It still shows every date. If not this is very acceptable and you can consider this ‘Solved’ if you like.
Thanks again!April 21, 2015 at 4:31 pm #15094Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
April 21, 2015 at 4:55 pm #15097smart367
ParticipantYou were too quick for me! I had already edited my earlier post to reflect my progress!
If I could disable the inline it would be perfect, but not a deal breaker…
Thanks Very Much!!!April 21, 2015 at 5:11 pm #15100Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- This reply was modified 10 years, 4 months ago by
- AuthorPosts
- You must be logged in to reply to this topic.