Ad dashboard time-display

This topic contains 8 replies, has 2 voices, and was last updated by  Aron Verhoeven 1 week, 2 days ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #35656

    Aron Verhoeven
    Participant

    Supported

    Hi Support,

    I’ve used the following code to change the date order (DD-MM-YYYY). However, when I insert this code (https://prnt.sc/p19ihz, the blue line), the date is deleting the exact time, after the date (so HH:MM:SS). That is just an little thing, but when I add the understanding code, it also fills in the dates for Ads which are not set as active yet.

    <td><?php echo citybook_addons_date_format( get_post_meta( get_the_ID(), ESB_META_PREFIX.'end_date', true) ); ?></td>

    Do you have any fix on this?

    Thanks in advance.

    Kind Regards,
    Aron Verhoeven

    #35657

    Aron Verhoeven
    Participant

    Supported

    So I mean: https://prnt.sc/p19lpz.

    There can’t be an ending date if the listing is not active yet.

    #35688

    CTHthemes
    Keymaster

    Sorry, I don’t understand the problem

    #35709

    Aron Verhoeven
    Participant

    Supported

    Sorry for not being clear at once.

    The mainpoint is that I would like to change the date order in the Ads Dashboard. It’s currently YYYY-MM-DD HH:MM:SS. I would like to change that to DD-MM-YY HH:MM:SS.

    I tried to make use of this code:

    <td><?php echo citybook_addons_date_format( get_post_meta( get_the_ID(), ESB_META_PREFIX.'end_date', true) ); ?></td>

    However, when using this code, there are two problems which occur:

    1. The date order is right (DD-MM-YY), but the time is deleted, so DD-MM-YYYY, without HH:MM:SS.
    2. When an Ad is still pending, normally the field will be empty untill the Ad is active. When using this code, the field of Ads which are not active yet, become visible with the date of today. See: https://prnt.sc/p19lpz. The 5 Ads on the top are not active yet, but still have an end date visible.

    Hope the problem is clear to you. Thanks in advance.

    Kind Regards,
    Aron Verhoeven

    #35976

    Aron Verhoeven
    Participant

    Supported

    Any fix on this? 🙂

    Thanks in advance.

    Kind Regards,
    Aron Verhoeven

    #36002

    CTHthemes
    Keymaster

    USe this code instead
    date('d-m-Y H:i:s', strtotime( get_post_meta( get_the_ID(), ESB_META_PREFIX.'end_date', true) ));

    #36014

    Aron Verhoeven
    Participant

    Supported

    Hi Support,

    Thanks for your reply 🙂

    The code resolves the first problem. However, not the second one as mentioned in Reply #35709. I’ve added the code: https://prnt.sc/p19ihz.

    The result is as follows: https://prnt.sc/p45610, so normally when the Add is still pending, the date notation remains an white field.

    Hope you understand me. Thanks in advance.

    Kind Regards,
    Aron Verhoeven

    #36021

    CTHthemes
    Keymaster

    Hello, the end_date is added first. So you can do check with $status:

    <td><?php if($status != 'pending') echo citybook_addons_date_format( get_post_meta( get_the_ID(), ESB_META_PREFIX.'end_date', true) ); ?></td>

    #36027

    Aron Verhoeven
    Participant

    Supported

    Cool, that worked out fine. Much thanks.

    I’ve combined the code above to: (to have it in my date order like: DD-MM-YYYY HH:MM:SS)

    <td><?php if($status != 'pending') echo date('d-m-Y H:i:s', strtotime( get_post_meta( get_the_ID(), ESB_META_PREFIX.'end_date', true) )); ?></td>

    For people who would like to know: https://prnt.sc/p45jd8, so its currently: https://prnt.sc/p45jw2.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

New featues: CityBook - Listing & Directory WordPress Theme version 2.1.8 was outUpdate now
+