Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author ovann86

    (@ovann86)

    Hi,

    I just wanted to say thanks for the honest feedback.

    I agree, it’s very crude but gets the job done (for now).

    I’ve just updated to version 1.1 and added the ability to specify the date format, which is a huge improvement.

    Let me know if you have any more ideas of how this can be improved.

    Thread Starter Md Akter Hosen

    (@tareqhi)

    Ok, fantastic, i have faced a little problem when i applied it on multi page form.
    The date fields not showing in some circumstances like adding new rows on second or later pages, but when the page failed validation, then its ok.
    I have added some code manually which fixes for me. Some jQuery on page_loaded hook & with add new row code in gravity forms core file.
    Overall its working great for me.

    Nice plug-in.

    One nice enhancement would be a way to set the default date for the datepicker. Right now it defaults to today’s date. Most of my users, however, will be entering in dates that are months in the future (usually starting in January of the following year), so they are currently forced to scroll through several months each time they enter in a date. What would be ideal is the ability to set the initial default date based on an earlier field in the form and then to have the default date for each subsequent row be based on the date set in the previous row. Would this be possible? Any ideas on how it could be done?

    Plugin Author ovann86

    (@ovann86)

    Hey rottenuncle

    How comfortable are you with PHP?

    I can add in a filter that’ll allow you to control some additional jQuery. For example, this would be the output and you would control the date part:

    jQuery(".datepicker").datepicker("setDate","2011/7/11");

    You would have to make sure the default date is in the same format as the date fields. And it would apply the default to all date fields in the form.

    For example, you would add in a apply_filter that outputs a date as a string – so using PHP you could make this a static date such as 01/01/2015 or do some PHP magic and calculate the desired date, such as the first Monday of the month.

    The filter would then fill in the date in the above.

    How’s that sound?

    Plugin Author ovann86

    (@ovann86)

    RE: default date.

    Update to version 1.25 and try adding this to your themes functions.php

    add_action('itsg_default_datepicker_date', function () {
        echo date("d/m/Y",strtotime('first day of January next year'));
    });

    (note the above assumes your date format is d/m/Y – change that to what you have configured the date picker field as)

    Thanks, ovann86. I will try this out.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Nice plugin’ is closed to new replies.