LISE Date/Time Custom Field

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

LISE Date/Time Custom Field

Post by rbaby »

Hi all,

How would you set the template to only display a record if the custom date time field you added is greater than today? Is this custom field definition also respectful of the timezone you set for the CMS or is it UTC?

Thank you!
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1812
Joined: Wed Feb 25, 2009 4:25 am

Re: LISE Date/Time Custom Field

Post by DIGI3 »

Not tested, but you'd want to do something like this:

Code: Select all

{$today=$smarty.now|date_format}
{$mydate=$item->fielddefs.mydate.value|date_format}
{if $mydate|strtotime > $today|strtotime}
  this date is in the future
{else}
  this date is right now or in the past
{/if}
It should use your server's local time, but you can confirm by echoing {$smarty.now} on any page.
Not getting the answer you need? CMSMS support options
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

Re: LISE Date/Time Custom Field

Post by rbaby »

Thank you DIGI3, I appreciate you taking your time to help me.
Locked

Return to “Modules/Add-Ons”