Support

Home Forums Event Espresso Premium Changing the Date format in the CSS Dropodown

Changing the Date format in the CSS Dropodown

Posted: June 4, 2013 at 11:05 pm


Lauren Pothof

June 4, 2013 at 11:05 pm

Hi,

I’d like to change the date format from Y-m-d in the CSS dropdown to “d-m-Y” (and if at all possible to include the weekday).

I tried changing the code in css_dropdown.php line 42 { .date ( ‘d-m-Y’ )} but it hasn’t had any effect… am I missing something?

Cheers!


Dean

June 4, 2013 at 11:33 pm

Hello Lauren.

There isnt a date format in that code by default, the date you changed is to do with checking the expired dates, so you may want to change that back just in case.

In the css_dropdown display.php file change the code there (there is actually only one line of code at the bottom) to the following:

   <a title="<?php echo stripslashes_deep($event_name)?>" class="a_event_title" id="a_event_title-<?php echo $event_id?>" href="<?php echo $registration_url; ?>"><?php echo event_date_display($start_date, get_option('date_format')); ?> - <?php echo stripslashes_deep($event_name)?></a>

All that does is add a date in.

If you want the date to be different to the rest of your site (it will follow the WordPress date setting in the Settings > General page) then you need to change it to the following and amend the dat format as needed

   <a title="<?php echo stripslashes_deep($event_name)?>" class="a_event_title" id="a_event_title-<?php echo $event_id?>" href="<?php echo $registration_url; ?>"><?php echo event_date_display($start_date, 'd-m-Y'); ?> - <?php echo stripslashes_deep($event_name)?></a>

You may need to tweak the CSS a little bit as adding this information in may shift things about.


Lauren Pothof

June 4, 2013 at 11:51 pm

Thanks Dean, I’ll give it a go. Cheers!


Lauren Pothof

June 5, 2013 at 4:00 am

Hi, That worked and in case anyone is interested I also managed to add in the event start time too…
<a title="<?php echo stripslashes_deep($event_name)?>" class="a_event_title" id="a_event_title-<?php echo $event_id?>" href="<?php echo $registration_url; ?>"><?php echo event_date_display($start_date, 'd-m-Y'); ?> – <?php echo espresso_event_time($event->id, 'start_time', get_option('time_format')) ?><?php echo stripslashes_deep($event_name)?></a>


Dean

June 5, 2013 at 4:14 am

Good job and thanks for sharing your updated code!

The support post ‘Changing the Date format in the CSS Dropodown’ 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