Support

Home Forums Event Espresso Premium Date format

Date format

Posted: February 11, 2016 at 11:24 am

Viewing 4 reply threads


kjr-pfaffenhofen

February 11, 2016 at 11:24 am

In WordPress > Settings > General screen I’ve defined the date format to d.m.Y
In the event form in the frontend the date format is m/d/Y. How can I change this? Many people of our website have problems with this m/d/Y format…


Josh

  • Support Staff

February 11, 2016 at 11:49 am

You can change the date format on the front end datepicker by adding this code to your site:

https://gist.github.com/joshfeck/e7a461c24fe75f6decaa

You can add the above to a functions plugin or into your WordPress theme’s functions.php file.


kjr-pfaffenhofen

February 11, 2016 at 11:22 pm

Hi Josh,
thanks for your quick reply! It does not work. Made I a mistake?
I created a Plugin, insert your Code and activated the plugin in WP. The Code:

<?php
/*
Plugin Name: Datumswandler für EventEspresso
Description: ändert das Datum im EventEspresso-Frontend bei Datepicker um in tt.mm.jjjj
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */

function jf_change_ee_reg_form_datepicker_format() {
    if ( is_page( 'registration-checkout' ) ) {
    ?>
        <script>
        jQuery(document).ready(function($) {
          $('.datepicker').datepicker({
            changeYear: true,
            yearRange: "1960:2016", //  for more info see http://api.jqueryui.com/datepicker/#option-yearRange
            dateFormat: 'dd.mm.yyyy'
          });
        });
        </script>
    <?php
    }
}
add_action( 'wp_footer', 'jf_change_ee_reg_form_datepicker_format' );

/* Stop Adding Functions */

In the Frontend after I use the date picker (for birthday), the date has the format m/d/Y.

Hope you can help me…


Tony

  • Support Staff

February 12, 2016 at 3:23 am

This line of the code:

if ( is_page( 'registration-checkout' ) ) {

Checks for a page called ‘registration-checkout’, looking over your site it appears you don’t have this page. It looks like you need to change that line to:

if ( is_page( 'kasse' ) ) {


kjr-pfaffenhofen

February 12, 2016 at 8:12 am

Hurray! You solved my problem! Thanks!

Viewing 4 reply threads

The support post ‘Date format’ 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