1 Reply Latest reply on Jan 18, 2009 7:42 PM by ntsiii

    compare date from xml data to new Date() in Repeater

    mordsm
      Hi All
      I am using repeater and while those following 2 display the same
      (when reaching the current day)
      <mx:Label text="{new Date().getDate().toString()}"/>
      <mx:Label text="{r.currentItem.dayofmonth}"/>

      the following line display nothing

      <mx:Label
      visible="{r.currentItem.dayofmonth==new Date().getDay().toString()?
      true:false}" text="{new Date().getDate().toString()}"/>


      Why? and how can I fix this?


      mordsm

        • 1. Re: compare date from xml data to new Date() in Repeater
          ntsiii Level 3
          Why is it not displaying, because of the text or because of the visible?

          Also, when working with repeater, I advise creating a custom component and repeat that. Pass in the entire currentItem on a public property. If you implement the property using getter/setter function pairs, you can debug the dataflow easily. (note, Property values are set on a component before its initialize or creationComplete events fire)

          Handlers can access the entire dataProvider item in its native dataType through the event.currentTarget property.