Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi again!

Is there an option to fetch only those cloned pages that were created in the last two months? Or is there any option to "subtract" dates?
Thanks again!! Much appreciated, as always!
Searched a bit around before, but sometimes it takes one who knows where to find the right thing.

I came up actually with a "couch" version in the meanwhile
Code: Select all
<cms:set current_year="<cms:date format='Y'/>"/>
<cms:set current_month="<cms:date format='m'/>"/>      
<cms:set current_day="<cms:date format='d'/>"/>                     
<cms:set start_month="<cms:sub current_month '2' />"/>
<cms:set start_day = current_day/>

<cms:if start_month le '0' >
   <cms:set start_year="<cms:sub current_year '1' />"/>
   <cms:set start_month="<cms:add current_month '12' />"/>
   <cms:set start_month="<cms:sub start_month '2' />"/>
</cms:if>
<cms:if current_month='1'>
   <cms:if current_day = '31'>
      <cms:set start_day = '30'/>
   </cms:if>
<cms:else_if current_month='2'>
   <cms:if current_day ge '28'>
      <cms:set start_day = '31'/>
   </cms:if>
<cms:else_if current_month='4'>
   <cms:if current_day ge '29'>
      <cms:set start_day = '28'/>
   </cms:if>
</cms:if>
<cms:show start_day/> <cms:show start_month/> <cms:show start_year/>

Counting 2 months backwards, the days would have to change if it would be the end of january (31st) to november (30th), the end of february (28th or 29th) to 31st of december and for april (30th) to february 28th.
3 posts Page 1 of 1