WordPress.org

Ready to get started?Download WordPress

Forums

Events Made Easy
[resolved] An empty 'End Date' is set as 'Start Date' and so always displays (24 posts)

  1. milestone
    Member
    Posted 1 year ago #

    Nice plugin! But one small bug...

    If I set a 'single day' event (and so only fill in the Start Date) then the End Date is automatically and wrongly set to the same date.

    This means if you display an end date in a template - #@_{d/m/Y} - it will always display a date even if you intend this field to be empty - thus the 'hint' that says "If there is no end date, the value is not shown." never applies.

    Currently the only workaround I've found to tidily show single-day and multi-day events together is to use the plugin's conditional tags:
    #_{d M Y} [events_if tag="#ESC_{d M Y}" notvalue="#ESC@_{d M Y}"]- #@_{d M Y}[/events_if]

    While I'm writing this, the calendar picker is hard-coded as m/d/y which is very confusing if the rest of the site is working in d/m/y format. It does store and display the dates in the correct 'user-chosen' format elsewhere however. And final aside - the Event Time input is hard coded as AM/PM; a lot of the world uses a 24hr time format and a toggle to switch input format somewhere would be nice!

    I hate having to moan about what is otherwise the best plugin of its type IMHO!!!

    http://wordpress.org/extend/plugins/events-made-easy/

  2. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    The end date needs to be set, otherwise some SQL statements don't work anymore. But I will remove the hint :-)

    For the calendar and datepicker: since they are jquery, they are based on the locale of wordpress (not any setting). So if your language is English, the hour will be shown in AM/PM and the date will be shown m/d/y. Of course I'm open to suggestions for other date/time pickers ...

  3. milestone
    Member
    Posted 1 year ago #

    Thanks Franky - I think we can mark the End Date 'bug' as sorted! And the display workaround is now up here now for all to see and use :)

    But for the date, my server and locale is GB not US, WP is set correctly and the rest of the site is displaying as UK norms (ie 24Hr and d/M/Y). It is just these calendar and time pickers that are not co-operating.

    Does this jquery ignore WP settings and use something deeper in the server that I haven't looked at yet?

  4. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    The workaround has been documented as an example in the conditional tag documentation for quite some time :)

    For the locale, I use this:

    // Check if the locale is there and loads it
       $locale_code = substr ( get_locale (), 0, 2 );
    
       $show24Hours = 'true';
       // Setting 12 hours format for those countries using it
       if (preg_match ( "/en|sk|zh|us|uk/", $locale_code ))
          $show24Hours = 'false';
    
       $locale_file = EME_PLUGIN_URL. "/js/jquery-ui-datepicker/i18n/ui.datepicker-$locale_code.js";

    Does this mean that the UK uses 24-hour format? So then that's easy to change, then I just needd to fix the datepicker (apparently the English locale file is not present, thus it takes the us version by default).

  5. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    I fixed it for en-GB: 24 hour format and correct jquery format (I hope)

  6. milestone
    Member
    Posted 1 year ago #

    Hi Franky

    Thanks for this v speedy fix! Your attitude really shines out!

    OK, I installed the dev version and I think there's a typo in the fix:

    "Parse error: syntax error, unexpected ',', expecting ')' in /home/scarlett/public_html/wax/wp-content/plugins/events-made-easy/events-manager.php on line 212"

    I'll take a look but you'll probably want to fix :)

  7. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    yeah, it was way too late last night :-)
    Also: I think I have "en-US" in the files, while it should be "en_US"
    and the datepicker locale file ui.datepicker-en-GB.js should probably be ui.datepicker-en_GB.js as well.
    I think I need to redownload the latest standalone version for the datepicker again ...

  8. milestone
    Member
    Posted 1 year ago #

    Update:

    Yep, just an unwanted extra comma before the new en-GB section on line 212.

    But the corrected version still makes no difference :( I've still got the default US date/time pickers.

    Just double-checked and the page source confirms I am <html lang="en-GB">, I have all the en-GB mo files and my config file is also set to en-GB.

    Can I ask whether anybody who is running an international version has got anything other than mdy and 12Hr? Perhaps everyone else just tolerates it?

  9. milestone
    Member
    Posted 1 year ago #

    Ack, hyphens, underscores...

    My site is now corrected to underscores (there's so little diff between US and UK in WP I hadn't noticed). I'd also corrected the hyphen to an underscore in your line 212 but as you say the datepicker js files might well throw everything so I think I'll just wait for you to reconcile everything now!

  10. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    This evening :-)

  11. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    Et voila, it should be ok in trunk now. In fact: wordpress uses underscores for it's locales (even though examples are confusing), while jquery datepicker uses hyphens ...

    Now it seems wordpress includes it's own variant of jquery datepicker now, so I'll try to switch to that one.

  12. milestone
    Member
    Posted 1 year ago #

    Fantastic Franky!!!

    Works now like a charm - had to quickly reset the dates on the events already in the DB, but that was nothing.

    So thank you for sorting out one bug that wasn't and one I didn't realize was one :) in only one day. Magnifique!

  13. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    No prob!
    But what do you mean with "had to quickly reset the dates on the events already in the DB" ? Was the date wrongly entered in the DB?

  14. milestone
    Member
    Posted 1 year ago #

    I never looked in the actual database, but when I looked in the admin after uninstalling old trunk and installing the new trunk, then the already entered events seemed initially to be in the unaltered (wrong) date format. So I just repicked them and they immediately resettled into the correct format. The times were already replaced by their 24Hr equivalents do I didn't have to touch them and a new test event had no 'problems' either.

    As mentioned before, the front end never wavered (presumably because the actual dates are immediately serialized into the DB). Some form of cache? Certainly not a biggie!

  15. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    In fact it's a leftover hyphen 'bug' causing the wrong localised format to be chosen initially ...
    Fixed here: http://plugins.trac.wordpress.org/changeset/688176/events-made-easy/trunk

  16. milestone
    Member
    Posted 1 year ago #

    That line 212 again!!!

    I guess the only thing to take out now is that erroneous hint about empty dates :)

    Show Time! Thanks again!

  17. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    And this change removes the possibility for that bug completely:

    http://plugins.trac.wordpress.org/changeset/688191

  18. milestone
    Member
    Posted 1 year ago #

    Very neat Franky!

    Just tested it and although it works absolutely great, I was a bit surprised to see on creating a new event that, before I did anything, there was an open calendar-picker just sitting at the very very bottom left of that page (couldn't be dragged). Selecting an actual date in the right place meant that it disappeared.

    Just tried that initial date-picker on a new event and it is totally non-functional.

  19. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    Yeah, I saw that too :-)
    I need to find out how to get rid of that one ...

  20. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    Would you mind trying if this solves it (don't have access here):

    http://forum.jquery.com/topic/datepicker-shows-a-div-at-the-bottom-of-a-page-on-loading

  21. milestone
    Member
    Posted 1 year ago #

    Initial positioning outside the visual frame with CSS? Don't have to get rid of it at all then...

    But there again I haven't looked to see how it's all being generated ;-)

  22. milestone
    Member
    Posted 1 year ago #

    Yep, just added that CSS tag to your main CSS file (probably not the best place!) and it does the trick perfectly.

    Success!!!

  23. Franky
    Member
    Plugin Author

    Posted 1 year ago #

    Well, I think it is the best place to put it :-)
    Nice to hear it works, will add it in trunk this evening (I hope).

    Btw: since you seem to be the first with running the trunk version: did you already play around with the new mail possibilities (see changelog for all new features)?

  24. milestone
    Member
    Posted 1 year ago #

    Can't say I have yet - this site is a freebie one I am hurriedly building for an artist that exhibits at a lot of art/craft fairs etc so nobody needs to sign up/be contacted. She just needs a site that is really easy to maintain as she is def not very tech literate! (Don't let her see that though! :) )

    But I hope, soon, on the back of it to design something more adventurous and then I do hope to use this same plugin in all its capabilities.

    So great to find it is so well supported - when the next site actually brings some money in I'll make sure some gets passed on!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic