Support

Home Forums Custom Files Add-on (EE3) Another espresso_table question – date formatting

Another espresso_table question – date formatting

Posted: November 13, 2013 at 11:46 am

Viewing 4 reply threads


infosolwebadmin

November 13, 2013 at 11:46 am

Sorry guys, back for more! I am using the espresso_table.php custom file template, how do I go about changing the date format? The table currently displays dates as:

Monday, Jun 16, 2014

Can you make it so that the day of the week is abbreviated and the month is fully written out? So for example: Mon, June 16, 2014 would be our ideal format. I’ve got a lot of other things to work on at the moment and don’t have time to search on php date formatting so I figured I’d ask. I also have another quick question that I will just throw in here as well:

When you add an event to your shopping cart and then view your cart it shows the events name/date/time, the ticket name/price/ticket amount dropdown, and then it’s got text that says ‘You can register a maximum of X attendees for this event.’

What would be the easiest way to get rid of that text? I looked through the templates and didn’t find anything.

Thanks!


Sidney Harrell

November 13, 2013 at 12:15 pm

The easiest way to get rid of that text is with some CSS:

.reg-allowed-limit {
display: none;
}

And for espresso_table.php, I think you want line 198:

<?php $date = date( get_option('date_format'), strtotime($event->start_date) ); ?>

Instead of using the WP defined date_format, you would specify with:

<?php $date = date( 'D, F j, Y', strtotime($event->start_date) ); ?>


infosolwebadmin

November 14, 2013 at 12:13 am

Thanks Sydney, the css worked and I ended up just needing to change the date format I had in my espresso table file (it appears to be different and shorter line wise than what you posted) to ‘D, F j, Y’ and it’s working how it should!

I’ve got one last quick question. When you add an event to your cart and view your cart, how do you get the number of tickets for that event to default to 1 instead of 0? A coworker and I have looked around the forums for answer and have yet to find one with code that will work for us.

Thanks!


Tony

  • Support Staff

November 14, 2013 at 7:15 am

Hi Yolanda,

The simplest way to do this is via jQuery.

Josh posted an exmaple here https://eventespresso.com/topic/cart-ticket-dropdown-defaults-to-0/


infosolwebadmin

November 14, 2013 at 9:54 am

Thank you Tony, that one worked!

Viewing 4 reply threads

The support post ‘Another espresso_table question – date formatting’ 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