Events date picker Calendar control?

Is events plugin meant to have calendar date picker? I just installed it and it want me to write date in manually but gives me no hint of format required making it a pain in the ass. Like the rest of the world I also don’t use American date format so it’s going to be extra confusing. Is there meant to be a pop up date picker or is this just how it works??

  • Patrick Cohen
    • Technical Docs Wrangler

    Hey there @Mike

    I hope you're having a great day!

    Indeed, there is a date picker available in both the admin editor and the frontend form (if frontend editing addon is enabled).

    If it is not showing on your site, there is likely a jQuery/JS conflict with another plugin, or perhaps even your currently active theme.

    Have you tested for such possible conflicts by implementing basic troubleshooting protocol as illustrated in the diagram at the bottom of this page?

    https://wpmudev.com/manuals/using-wpmu-dev/getting-support/

    [attachments are only viewable by logged-in members] [attachments are only viewable by logged-in members]

  • oncourssadmin
    • Site Builder, Child of Zeus

    Ok, I just realized what the problem was, for me at least, I was checking off no end time but the system still needed an end date in order to satisfy itself that the data entry was correct – it is not clear that when you check off no end time that you still need to enter a date, maybe auto-populate the end date field with the start date to indicate that the field is required? (date picker is still missing on first day in Chrome though)

  • Sajid
    • DEV MAN’s Sidekick

    Hi @Mike! Hope you are doing good today :slight_smile:

    I just checked on my sandbox multisite running latest WordPress and Events+. Its working fine for me on both sections edit/add. I am using Chrome on windows 7. It might be an extension interfering with date-picker. Try to disable some extensions (if any) and update the chrome browser. Also clear the browser cache/cookies and then check again.

    Do you still facing this issue ? If yes then please try to delete this entirely and install again.

    Hope it helps :slight_smile:

    Cheers, Sajid

  • Mike
    • The Bug Hunter

    The jQuery datepicker() is not getting attached to element id “incsub_event_start_0”.

    If I run jQuery(‘#incsub_event_start_0’:wink:.datepicker(); in the JavaScript console the the date picker functions correctly.

    I have looked into code and believe I can see the error.

    Here is how you add the datepicker() to the input controls:

    jQuery("#eab-add-more-button").click(function() {
    row_id = jQuery('.eab-start-section').length-1;
    jQuery("#eab-add-more-rows").append(jQuery("#eab-add-more-bank").html().replace(/_bank/gi, '_'+row_id).replace(/bank/gi, row_id+1).replace(/_b/gi, ''));

    jQuery( "#incsub_event_start_"+row_id+" , #incsub_event_end_"+row_id ).datepicker({
    "dateFormat": "yy-mm-dd",
    "changeMonth": true,
    "changeYear": true,
    "firstDay": parseInt(eab_event_localized.start_of_week, 10) ? parseInt(eab_event_localized.start_of_week, 10) : 0
    });
    if (jQuery('.eab-section-block').length > 2) {
    jQuery('.eab-section-heading').show();
    }
    });

    As you can see it only adds the control when you add an additional date. It does not add it to the initial control.

    Here is the code you initialize the initial datepicker()s :

    // Init jQuery UI date selectors
    $("#eab_event-repeat_start,#eab_event-repeat_end").datepicker({
    "dateFormat": "yy-mm-dd",
    "changeMonth": true,
    "changeYear": true,
    "firstDay": parseInt(eab_event_localized.start_of_week, 10) ? parseInt(eab_event_localized.start_of_week, 10) : 0
    });

    The ID on the initial recurring event inputs are “incsub_event_start_0” and “incsub_event_end_0”. No where in your code are these initialized. Only subsequent ones that are added through the first code block I have pasted.

    As it works for you I will not modify the code myself in case I create a conflict. Can you show me the code that initiates the datepicker() on “incsub_event_start_0” and “incsub_event_end_0” in your code so I can see why it is not working?

    I cannot see any such code existing in the plugin so I am a little baffled how it works for you. I thought maybe the fields got renamed by accident but I could not find any other code to add the datepicker(). Did something get deleted in an update and you are using an older version?

    PS. I am working locally. Do I still have to give you access?

  • Mike
    • The Bug Hunter

    OK, I found the error. It is this code block:

    if (!("ontouchstart" in window)) {
    jQuery(".incsub_event_picker").datepicker({
    "dateFormat": "yy-mm-dd",
    "changeMonth": true,
    "changeYear": true,
    "defaultDate": new Date(),
    "firstDay": parseInt(eab_event_localized.start_of_week, 10) ? parseInt(eab_event_localized.start_of_week, 10) : 0
    });
    }

    In chrome “ontouchstart” in window evaluates to true. In firefox it evaluates to false.

    Any fix available?

  • Sajid
    • DEV MAN’s Sidekick

    Hi @Mike! Hope you are doing good today :slight_smile:

    Thanks for providing all these details, much appreciated. Yes! It could be touch event. Just to make sure, Can you disable touch temporarily and use click event instead.

    http://lifehacker.com/disable-your-laptop-s-touch-screen-in-windows-8-1-1588333600

    Its time to escalate this thread to SLS (Second Level Support) staff for their invaluable feedback on this matter. Please bear in mind their response may be slower than normal support. Because they work on advanced and technical threads, like yours :slight_smile:

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Mike
    • The Bug Hunter

    I don’t have any touch enabled devices, I am using a standard pc with keyboard and mouse.

    It seems that chrome reports that true as it detects that win 8.1 is touch capable. Firefox does not detect this yet but I assume it will do eventually also. An alternative way needs to be defined for detecting if touch will be used or not.

    However, it seems kind of redundant when you specify the other two fields explicitly anyway.

  • Sajid
    • DEV MAN’s Sidekick

    Hi @Mike! Hope you are doing good today :slight_smile:

    It seems that our SLS team is quite busy with complex threads and their response took more than expected here. I pinged again and they will get back to you ASAP.

    Thanks for your patience, much appreciated :slight_smile:

    Cheers, Sajid

  • Jose
    • Bruno Diaz

    Hello Mike,

    Hope you are doing great.

    I was testing on Win 8.1 and latest chrome but couldn’t reproduce the issue.

    'ontouchstart' in window evaluates correctly for me (returns false).

    Are you positive that when debugging this in the console the device emulation is turned off? (see attached image)

    I read somewhere that windows 8 could take a touchpad as a touchscreen under certain devices and configurations. But can’t be sure if that information is correct.

    Could you please add the following snippet into your theme’s functions.php and let me know what result do you get in the console?

    add_action('wp_footer', 'test_touch_capability');
    add_action('admin_footer', 'test_touch_capability');

    function test_touch_capability(){
    ?>
    <script type="text/javascript">
    jQuery(
    function(){
    var result = 'ontouchstart in window: ' + ('ontouchstart' in window);
    result += 'n navigator.maxTouchPoints: ' + navigator.maxTouchPoints;
    result += 'n ontouchstart in document.documentElement: ' + ('ontouchstart' in document.documentElement);
    result += 'n window.onmsgesturechange: ' + window.onmsgesturechange;
    result += 'n window.DocumentTouch: ' + window.DocumentTouch;

    console.log(result);
    //alert(result);
    }
    )
    </script>
    <?php
    }

    Please advise.

    Cheers,

    José

    [attachments are only viewable by logged-in members]