ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Test a date field to see if post is displayed - not using post expiry!

October 06, 2011 8:03am

Subscribe [1]
  • #1 / Oct 06, 2011 8:03am

    cordial

    1 posts

    I’m using a Matrix field to populate content on a page.

    In my Matrix grid I’ve got two standard date fields for an ‘enable’ date and a ‘disable’ date.

    I just need to test if the current date is between these, and if so, display the content.

    I’m wondering if anyone knows of a quick way to work this? I’m very new to this kind of conditional testing!

    Any advice is appreciated, thanks!

  • #2 / Oct 06, 2011 9:30am

    cordial

    1 posts

    Managed to work this out myself!

    {if enable < current_time}
    {if disable > current_time}
    
    content here
    
    {/if}
    {/if}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases