Ask the community

This is a community support forum where you can ask
questions and interact with other PremiumPress Customers.

9.24 | WP Date / Time Format ? Add new listing / date time picker conflict?

  • Chris
    Chris
    Newbie 36 points
    January 9, 2019 at 10:58 am

    Anyone else having problems getting the date picker to work? If not? what are your WP Date format settings set to?

    When using the date/time picker in the “Create new coupon” admin – it fails to work, and when checking the dev console there is the following error:

    jquery-ui-timepicker-addon.min.js?ver=1.6.1
    Error parsing the date/time string: Unexpected literal at position 10
    date/time string = January >9, 2019
    timeFormat = HH:mm
    dateFormat = MM d, yy

    I figured this might be a setting in WP>Settings>General>Date Format
    However, I cannot seem to get the date picker to work or this error to go away regardless of the settings.

    Attachments:
    You must be logged in to view attached files.
  • Chris
    Chris
    Newbie 36 points
    January 12, 2019 at 3:32 pm

    does anybody’s Date Picker work?

  • JamesD
    JamesD
    Super Guru 1,345 points
    January 12, 2019 at 9:45 pm

    Hello Chris,
    Couple questions…
    Which version of WP are you using?
    Have you made any custom changes with any of the add-listing templates/files or anything within Elementor that impacts the add listing?

    [Added after initial post]
    Does the same thing happen when trying to edit a coupon?

  • Chris
    Chris
    Newbie 36 points
    January 13, 2019 at 7:14 am

    9.24

    No changes to add-listing files or elementor files. Errors on editing coupon as well..

    Upon deeper investigation, it looks to be a conflict with Advanced Custom Fields ACF which is a massively popular plugin. /wp-content/plugins/advanced-custom-fields/assets/inc/timepicker/jquery-ui-timepicker-addon.min.js?ver=1.6.1 if what is trying to handle the coupon date picker, or there are class/ID name conflicts.

    This is currently a massive pain as I am rebuilding my 8.9 site in 9.24 with 1000+ coupons and a date picker conflict..

    Any ideas for a workaround?
    Thanks

  • Chris
    Chris
    Newbie 36 points
    January 13, 2019 at 9:41 am

    Found the solution for anyone else having conflicts with ACF.. Perhaps this can get a bug fix in 9.25

    from ACF forums:
    “…. the 3rd party theme has used a class name matching ACF’s internal naming convention. This has led to the conflict.

    Furthermore, where ACF wraps it’s classes in an if statement to avoid duplicate classes, this 3rd party theme has not. it causes the duplicate class issue.”

    Since I do not currently use the ACF date picker – I just commented out lines 284/285 of acf.php in the ACF plugin directory (that include the timepicker script) and that solved my problem for now.

    Cheers!

  • JamesD
    JamesD
    Super Guru 1,345 points
    January 13, 2019 at 8:13 pm

    @Chris,

    Thanks for the update.

    I can confirm there is a conflict with the latest version of ACF (checked 5.7.9) with the theme, however the problem doesn’t exist with v5.5.3.

    I’d recommend contacting PP support if you still run into problems.

  • JamesD
    JamesD
    Super Guru 1,345 points
    January 13, 2019 at 8:48 pm

    @Chris

    You could also change line #110 (acf.php) 'enqueue_datetimepicker' => true, to 'enqueue_datetimepicker' => false, if that’s’ any easier.

  • JamesD
    JamesD
    Super Guru 1,345 points
    January 13, 2019 at 10:29 pm

    @Chris

    I should also add that either of those methods (changing ACF core files) are more of “hacks” and not really the best.

    Note: The following method is recommended.
    Ideally, you would want something like this within your ‘_functions.php’ file:

    function pp_acf_init() {
        acf_update_setting('enqueue_datetimepicker', false);
    }
    add_action('acf/init', 'pp_acf_init');

    If you already have a custom function for the ‘acf/init’ then just add acf_update_setting('enqueue_datetimepicker', false); within that function.

  • Chris
    Chris
    Newbie 36 points
    January 15, 2019 at 6:00 am

    Thanks James, great idea. I’ll add that instead.

  • JamesD
    JamesD
    Super Guru 1,345 points
    January 15, 2019 at 8:38 pm

    You’re Welcome Chris.
    If you need to change any of the other initial ACF settings then that function is where you would place it.

Viewing 10 posts - 1 through 10 (of 10 total)