All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Check: does event start in next 48 hours?

StevenLangbroek 26 Apr 2013 12:51 question, complete

Hey Low,

My client put in a request for some functionality that I have no idea how to do it:

On an event (single entry) page, I need to check if the event starts within the next 48 hours. Based on that I need to show or hide a "signup" button.

How would I go about this? Any thoughts?

Thanks!

Replies

  1. Low 26 Apr 2013 13:14

    You could do it if you enable PHP. Output or input, doesn't matter:

    <?php 
    $twodays = time() + 172800;
    ?>


    This sets a timestamp for 48 hours in the future. Then use this conditional:

    {if '{event_dates:start_stamp}' <= '<?=$twodays?>'} ... {/if}


    Untested, but I think it should work.