Site logo

[Support request] Page Hero: formatting date output from custom field (The Events Calendar)

Home Forums Support [Support request] Page Hero: formatting date output from custom field (The Events Calendar)

Home Forums Support Page Hero: formatting date output from custom field (The Events Calendar)

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1825309
    Matthias

    Hey, Tom and GeneratePress team,

    I am creating a page hero for events generated by The Events Calendar. This is the hero:

    http://staging.kukusta.de/veranstaltung/testprojekt-5/

    Screenshot:
    https://paste.pics/27fa1fa3396a941e428ad54828a10ab2

    And this is what’s in it:

    <div style="text-align:center;">
    <h1>
    	{{post_title}}
    </h1>
    
    <p>
    	{{custom_field._EventStartDate}} - {{custom_field._EventEndDate}}
    </p>
    </div>

    As you can see, I am using The Event Calendar’s custom field names (which are documented here) for start and end times. Now, I would like them to show up as:

    23. Jul 16:00 – 23. Jul 17:00

    Is there any way to format that output? TEC can do it, as you can see in the subheading when scrolling down.

    #1825624
    Leo
    Staff
    Customer Support

    Hi there,

    The theme doesn’t handle the format of date and time.

    Can you try modifying it here?
    https://wordpress.org/support/article/settings-general-screen/#date-format

    Let me know 🙂

    #1825740
    Matthias

    Hey Leo, thanks for your quick reply. WordPress’s own date and time settings bear no effect on how The Event Calendar’s own dates and times are formatted. TEC does have its own settings for that, and they seem to work within TEC’s own default templates (you can see that when you scroll down on the event I linked).

    The problem seems to be that when I use the template tag functionality that GP provides so I can put the contents of those TEC fields in the hero, that’s when I only seems to output the raw data stored in the database. Which leads me to believe that TEC itself has code that parses and formats that data, and that code won’t work outside TEC?

    #1825749
    Leo
    Staff
    Customer Support

    The problem seems to be that when I use the template tag functionality that GP provides so I can put the contents of those TEC fields in the hero

    GP doesn’t add any template tags for TEC by default – I would assume that TEC is adding the custom fields.

    Any chance you can check with their support team first?

    Let me know if I’m missing something here 🙂

    #1825754
    Matthias

    Hi Leo, yeah, I looked up the names of the custom field names that TEC uses on their own documentation and used the GP custom field name template tag to implement this one. I will check in with TEC support to see whether they can help.

    #1825756
    Leo
    Staff
    Customer Support

    Sounds good. Let me know 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.