Datepicker Settings in Quform

Home Forums Quform WordPress Datepicker Settings in Quform

This topic is: resolved
  • This topic has 6 replies, 2 voices, and was last updated 9 years ago by Ally.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #15047
    smart367
    Participant

    I 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, Scott

    #15081
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #15089
    smart367
    Participant

    That’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 9 years ago by smart367.
    #15090
    smart367
    Participant

    I 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!

    • This reply was modified 9 years ago by smart367. Reason: Edited prior post, following up here
    • This reply was modified 9 years ago by smart367. Reason: Updated my progress
    #15094
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #15097
    smart367
    Participant

    You 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!!!

    #15100
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy