1
votes

I want to compare two dates in a condition with fluid in an extension in Typo3 6.2. Here is, what I have tried for now:

<f:if condition="{f:format.date(format : 'U', date : {orderdate})}
>= {f:format.date(format : 'U', date : {v:system.dateTime()})}">
  <f:then>
    do it
  </f:then>
  <f:else>
    do it not
  </f:else>
</f:if>

The viewhelper {v:system.dateTime()} from the vhs-extension returns the timestamp. But this code returns only the condition from the "then" statement. The condition is not working in this way...

My question is, how can I compare two dates within fluid? Does anybody know a solution?

1
1) what is the type of the ordinate? 2) what is the type (and value) of v:system.dateTime(), 3) what do you expect from the condition? 4) creating custom VH is easy task if you'll answer first 3 points I'll try to help you, but pls, describe it with samplesbiesior
Thank you for your respond. When I write the condition in inline style, then the statements functions! See my new code in the question.akunz
Write an answer then and accept it as validbiesior

1 Answers

1
votes

I found this solution: The code functions, when I write the condition in better inline style:

<f:if condition="{kurse.anmeldedate -> f:format.date(format : 'U')} >
{v:system.dateTime() -> f:format.date(format : 'U')}">
   <f:then>
      do it
   </f:then>
   <f:else>
     do it not
   </f:else>
</f:if>

The Viewhelper v:system.dateTime() gives the time now as a timestamp and is a VH from the extension VHS: Fluid ViewHelpers.