Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Hello,
How do I achieve this:
I have a registration form on my website and I want it to only show anytime the date period is between a particular period of time every year so something like this :
Code: Select all
<cms:if date=from 1st July - 30th September of every year>
{Show form}
<cms:else>
Registration closed
<cms:if>
Hello,

consider a date as a number between 0701 and 0930. Format can be md or Ymd.
Code: Select all
<cms:set mydate = "<cms:date some_date format='md' />" />

<cms:if mydate ge '0701' && mydate le '0930' >
   {Show form}
<cms:else />
   Registration closed
</cms:if>
Trendoman thanks so much for the code . However irrespective of which ever date period I use the registration remain closed so I want to know the use of the some_date variable inside the <cms:set ..../> tag.

NB: I used the solution you gave as-is
Try with this statement before the posted 'as-is' code:
Code: Select all
<cms:set some_date = '2017-08-15' />
@adimpressions, If the requirement is to check if the *current* date falls between the two dates, you can modify the first statement in @trendoman's original code to make it as follows -

Code: Select all
<cms:set mydate = "<cms:date format='md' />" />

<cms:date> with not date explicitly specified will default to the current date.
Thanks Trendoman and KK I got it to work. Thanks so much for your support :oops:
6 posts Page 1 of 1