Support

Home Forums Event Espresso Premium Datepicker in registration form adding an "s" after date number

Datepicker in registration form adding an "s" after date number

Posted: February 27, 2017 at 9:26 am

Viewing 4 reply threads


devonto

February 27, 2017 at 9:26 am

It seems that the ordinal suffix modifier for a date once selected by the datepicker in a registration form is using an “S” character, rather than converting it into the appropriate “rd, th, st, nd”.


Tony

  • Support Staff

February 28, 2017 at 9:51 am

Hi there,

EE uses the the jQuery datepicker library which doesn’t provide an option for this, you’ll need to use another date format for the datepicker which you can do with a snippet such as this:

https://gist.github.com/Pebblo/1fa642d3374848b9027a38cbdd9f3d99

That function can be added to your themes functions.php file or a Custom Functions Plugin.

Or you could add your own onSelect function to add the suffix in yourself if preferred, I did a quick search and found an example of this here:

http://stackoverflow.com/questions/8199204/adding-st-nd-rd-th-to-jquery-datepicker


devonto

February 28, 2017 at 12:55 pm

Thanks for the reply… it turns out it is actually part of the WordPress core that is at fault.

Checking the source code, just after datepicker.min.js is included, there are default parameters set. One of which was:

"dateFormat":"dS MM yy"

Going into the WordPress configuration under “Settings” then “General”, it had the default UK parameter set as jS F Y.

This must then be translated into the jQuery format of dS MM yy.

If I change the WordPress date setting to d/m/y, the issue is resolved.

A more suitable fix would be to have wp-includes/script-loader.php handle the unknown ‘S’.
I’ll submit a bug report to WordPress for this now.


Tony

  • Support Staff

February 28, 2017 at 1:02 pm

Ok, great. Nice find 🙂


devonto

February 28, 2017 at 1:04 pm

Many years using WordPress, first “bug” I’ve found!

https://core.trac.wordpress.org/ticket/39991

Viewing 4 reply threads

The support post ‘Datepicker in registration form adding an "s" after date number’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso