Skip to main content
Inspiring
Aug 21, 2006 5:06 PM UTC
Answered

CFCALENDAR & Actionscript

Hello,

I am using the following code to refresh a page with the current date selected when a user selects a date from the calendar.

<cfparam name="thisdate" default="#now()#">

<cfcalendar name="CurrentDate"
mask="mm/dd/yyyy"
dayNames="SU,MO,TU,WE,TH,FR,SA"
style="rollOverColor:red"
width="230" height="150"
selecteddate="#DateFormat(thisdate,"mm/dd/yyyy")#"
onChange="getURL('ReserveGrid.cfm?thisdate='+CurrentDate.selectedDate)">


This works fine for returning the month and day, but it returns 2000 as the year (no matter what year I select). Any ideas as to why it is only recognizing the month and day, and not the year?

Thanks!

(CFMX 7.02, Windows 2003)
    This topic is closed to new replies. Start a new post to keep the conversation going.
    Jim StoutCorrect answer
    Inspiring
    Aug 21, 2006 6:44 PM UTC
    Actionscript creates a date in the following format:

    Wed Mar 13 00:00:00 GMT-0700 2002

    So I had to create a new date based on this text string for CFMX’s consumption:

    <cfset thisdate = #CreateDate(Right(thisdate,4),Month(thisdate),Day(thisdate))# >

    1 reply

    Jim StoutAuthorCorrect answer
    Inspiring
    Aug 21, 2006 6:44 PM UTC
    Actionscript creates a date in the following format:

    Wed Mar 13 00:00:00 GMT-0700 2002

    So I had to create a new date based on this text string for CFMX’s consumption:

    <cfset thisdate = #CreateDate(Right(thisdate,4),Month(thisdate),Day(thisdate))# >
    Translate