• Resolved dhomeal

    (@dhomeal)


    Hi

    I just bought the pro version for my organization but I need to extend as specific function.

    I know javascript and jQuery, I also read the documentation about jQuery datepicker functions, but is not so familiar with editing Word Press plugins. I can’t get to add max or minDate for a datepicker, if I try to find it with jQuery. I have tried to get to the datepicker by using the the id selector (“#ID”) but non of the functions I add by (“#ID”).datpicker(“some function”) seems to work.

    So my question is, where do I customize this plugin? I would like to not touch the php files, but where and how do I customize this?

    Hope it all make sense
    /Daniel

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Fahad Mahmood

    (@fahadmahmood)

    Daniel,

    Yes, it all make sense. I appreciate that you contacted me here. Exactly, you don’t need to touch the PHP files and also not required to modify the plugin files.

    Did you get a chance to see these two options on settings page?
    https://prnt.sc/kfsjep

    The other way, you are trying to modify the settings, is:
    Follow the extends syntax from the plugin example
    .datepicker($.extend(

    Link: Demo Source

    Line no. 312

    In case, you don’t feel comfortable with both options and want me to help you in it so please reach me through the same demo website.

    Thanks,
    Fahad

    • This reply was modified 6 years, 7 months ago by Fahad Mahmood.
    Thread Starter dhomeal

    (@dhomeal)

    Hi Fahad, and thanks for getting back this quickly!

    Fact is that I have two datepickers, (check in / check out)
    where I want to set the minDate of the checkout picker, after the user has selected from the check in datepicker.

    I tried to use the syntax from the Demo Source like this:

    $('#check-in').datepicker($.extend(
    {},
            $.datepicker.regional["en-AU"]
        ));
    

    But that does not work for me. ??

    Also the code from the Demo Source line 312, seems to be inside the function wpdp_refresh, which is defined on the functions.php in the plugin, so I think I still doing it all wrong..

    • This reply was modified 6 years, 7 months ago by dhomeal.
    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    No, you are doing it correct. Make sure that you are not doing it twice. For example, “#check-in” should be once on the page. Either use it from settings page or in your custom JavaScript. One more thing to make sure, you are using jQuery instead of $ sign or you are wrappign $ with

    jQuery(document).ready(function($){ 
    //your custom script goes here
    });

    Don’t worry about refresh function or anything else. Plugin files are modified time to time according to different cases. Don’t be confused with that complex implementation. Try it with simple one.

    Thread Starter dhomeal

    (@dhomeal)

    I checked and I only have one element with the id #check-in.

    Even tried changing the ID but no luck

    Here is my full script:

    <script>
    // USE OF jQuery!
    jQuery(document).ready(function($) { 
    
    $('#check-in').datepicker($.extend(
    {},
            $.datepicker.regional[ "en-AU" ]
        ))
    
    })
    
    </script>
    

    No matter what setting I use I can’t access the datepicker.

    I tried to see if I could print the value
    by using setInterval, and I can:

    setInterval( () => {
       console.log( $('#check-in').val() ); // prints something like : 2018-02-12
    
    }, 5000 )
    

    But when I try to access any settings on the datepicker, it gets me no where.

    • This reply was modified 6 years, 7 months ago by dhomeal.
    Plugin Author Fahad Mahmood

    (@fahadmahmood)

    I think, when you are using this kind of custom code so plugin isn’t required anymore. The reason is, plugin was developed for those who don’t need customization at this level. I would suggest, directly include jquery and jquery ui through WordPress and use the same custom scripts so no conflicts should be there due to plugin code. The other way, let me have a look into it if it’s possible so join me through https://demo.androidbubble.com/contact/

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Where To Customize Plugin’ is closed to new replies.