altho the built in function takes a full date object as an argument
(so as to handle february months...needs the year to be able to
determine leap year or not).

On 2/2/07, Charlie Griefer <[EMAIL PROTECTED]> wrote:
> you do know there's a built-in daysInMonth() function, yes? :)
>
> On 2/2/07, daniel kessler <[EMAIL PROTECTED]> wrote:
> > I made two cfscript functions.  I cfinclude them.  They seem to work fine, 
> > but now that I have them where I want them, I'm receiving an error that 
> > didn't previously show:
> >
> > Entity has incorrect type for being called as a function.
> > The symbol you have provided monthDays is not the name of a function.
> >
> >
> > Here are the functions:
> >
> >                                 <cfscript>
> >
> >                                         function 
> > makeDate(a_day,a_month,a_year,a_type){
> >
> >                                                 var the_type = "begin";
> >                                                 var the_day = 1;
> >                                                 var the_month = 1;
> >                                                 var the_year = 1966;
> >
> >                                                 if (a_type NEQ ''){the_type 
> > = a_type;};
> >
> >                                                 if(the_type NEQ 'begin'){
> >                                                         the_month = 12;
> >                                                         the_day = 
> > monthDays(the_month);
> >                                                         if(a_month NEQ ''){
> >                                                                 the_day = 
> > monthDays(a_month);
> >                                                         }
> >                                                         the_year = 
> > (year(now()))+10;
> >                                                 }
> >
> >                                                 if (a_day NEQ ''){the_day = 
> > a_day;};
> >                                                 if (a_month NEQ 
> > ''){the_month = a_month;};
> >                                                 if (a_year NEQ ''){the_year 
> > = a_year;};
> >
> >                                                 return 
> > CreateODBCDate(createDate(the_year,the_month,the_day));
> >                                         }
> >
> >                                         function monthDays(daMonth){
> >                                                 switch (daMonth) {
> >                                                         case '1':
> >                                                         case '3':
> >                                                         case '5':
> >                                                         case '7':
> >                                                         case '8':
> >                                                         case '10':
> >                                                         case '12':
> >                                                                 monthDays = 
> > 31;
> >                                                                 break;
> >                                                         case '4':
> >                                                         case '6':
> >                                                         case '9':
> >                                                         case '11':
> >                                                                 monthDays = 
> > 30;
> >                                                                 break;
> >                                                         case '2':
> >                                                                 monthDays = 
> > 29;
> >                                                                 break;
> >                                                 }
> >
> >                                                 return monthDays;
> >                                         }
> >
> >                                 </cfscript>
> >
> > 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7 
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs 
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:268508
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to