Pass in -1 as the day, eg. the date of the last day of February is Date(2008,2,-1); Cheers Ralf.
On Wed, Jun 11, 2008 at 2:02 PM, Michel Scoz <[EMAIL PROTECTED]> wrote: > > > There you go... > > > > public function getLastDayOfMonth(month:Number, year:Number):Number > > { > > var lastDay:Number; > > > > if (month == FEBRUARYNUMBER) > > { > > if (((year % 4) == 0 && (year % 100)!=0) || (year % > 400)==0) { > > lastDay = 29; > > } else { > > lastDay = 28; > > } > > } else if((month < 7 && month % 2 == 0)||(month >= 7 && > month % 2 == 1)) { > > lastDay = 31; > > } else{ > > lastDay = 30; > > } > > return lastDay; > > } > > > > ________________________________ > > De: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] Em nome > de Indra Prastha > Enviada em: quarta-feira, 11 de junho de 2008 05:33 > Para: flexcoders@yahoogroups.com > Assunto: [flexcoders] Finding the last day of the month > > > > Hi, > > I used to work with Coldfusion where they have this function like > DaysInMonth(date), to obtain the last day of the month (31 / 30, or 28 / 29 > for feb / leap year) > ,and it's very handy, is there anyway I could achieve the same function in > Flex? > > Thanks. > > Cheers! > > Indra Prastha, > [EMAIL PROTECTED] > ERP Team @ DataOn Corp. > > ________________________________ > > > > -- Ralf Bokelberg <[EMAIL PROTECTED]> Flex & Flash Consultant based in Cologne/Germany