Zopists: I am looking to equate two DateTime objects of different percision for the day in a DTML expression like so: <!--#if "date==appointment_date"--> <!--#var foo--> <!--#/if--> Where date is today and appointment date is whenever. However because one or more of the dates has percision to the hour, and the other just to the day, does anyone know how to equate them just on the day level. In other words: <!--#if "date fmt=dayOfYear==appointment_date fmt=dayOfYear"-->;) OR <!--#if "_.dayOfYear(call_date)==_.dayOfYear(date)"--> After reading the DateTime module I can't tell how to equate just the day portion of a DateTime object. Any hints? -- Jason Spisak webmaster@mtear.com
Zopists:
<!--#if "date==appointment_date"--> <!--#var foo--> <!--#/if-->
If date refers to 'now' you can do <!--#if "appointment_date.isCurrentHour()"--> <!--# var spam--> <!--# /if--> If you want to compare two arbitrary datetime objects to the day then: <!--#if "appointment_date.dayOfYear()==date.dayOfYear()"--> <!--# var spam--> <!--# /if--> both untested Pavlos
Pavlos: Thanks. You beat me to the punch. Thanks so much. Jason Spisak webmaster@mtear.com Pavlos Christoforou wrote:
Zopists:
<!--#if "date==appointment_date"--> <!--#var foo--> <!--#/if-->
If date refers to 'now' you can do
<!--#if "appointment_date.isCurrentHour()"--> <!--# var spam--> <!--# /if-->
If you want to compare two arbitrary datetime objects to the day then:
<!--#if "appointment_date.dayOfYear()==date.dayOfYear()"--> <!--# var spam--> <!--# /if-->
both untested
Pavlos
-- Jason Spisak webmaster@mtear.com
participants (2)
-
Jason Spisak -
Pavlos Christoforou