Hello,
try this also
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
<mx:DateField change="setTaskDate(dtTaskDate.selectedDate)"
creationComplete="setTaskDate(new Date())"
                    id="dtTaskDate"/>
<mx:Script>
<![CDATA[
public function setTaskDate(taskDate:Date=null):void
{
 if (taskDate)
{
        dtTaskDate.text=DateFunctions.formatDateAsString(taskDate);
}
}
]]>
</mx:Script>
</mx:Application>

Regards
Lal
On Jul 29, 10:50 am, "[email protected]"
<[email protected]> wrote:
> The following code would just work
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="absolute">
>         <mx:DateField selectedDate="{new Date()}" />
> </mx:Application>
>
> Thanks
> Harish
>
> On Jul 29, 10:20 am, vrathore <[email protected]> wrote:
>
>
>
> > Hello,
>
> > To set the current date in the dateField just call the following line
> > on creation complete
> > newDate.text = new Date().toDateString();
> > Where newDate is the Id of the DateFeild
> > <mx:DateField id="newDate" change="SetChange()" />
>
> > This function determines if the selected date is greater than current
> > date.
> >            private function SetChange():void{
> >                 if(newDate.selectedDate > new Date())
> >                 {
> >                         Alert.show();
> >                 }
> >             }
>
> > Cheers
> > Varun
>
> > On Jul 29, 9:57 am, Gerald Anto <[email protected]> wrote:
>
> > > Hello Friends,
> > > How to set current date as default date in DateField control and well
> > > as not able to select future days.
> > > shall we have it in mxml syntax or AC.
> > > anyway if possible send some samples.
>
> > > Thanks&Regards,
> > > Gerald A- Hide quoted text -
>
> - Show quoted text -

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to