Copy link to clipboard
Copied
It's me again .. im having two littles questions....
1. The truth Is that i need help with dateformat in <cfcalendar>.
the dateformat defaults its mm / dd / yyyy and I live in Latin America and for most I have tried and not been able to change that.
if I change the format to dateformat dd / mm / yyyy I still have the month ahead so i dont get the dates i wish.
im trying to get in those cases 06/12/09... :s
2. can be obtained only calendars that are next to the texfield without having to draw the big calendar?? How??
i wold like to have only the calendars next to
"FECHA DE INICIO" [ date ] "calendar"
"FECHA FINAL" [ date ] "calendar"
and "CONSULTAR" button for submit dates.
sorry for the inconvenience ... not knowing is just not knowing.
Juan Martinez
PD: under this the calendar code.
this is the calendar that i made...
<!--- Set initial selected and blocked-out dates.--->
<cfparam name="Form.startdate" default="#dateformat(now()-5, 'mm/dd/yyyy')#">
<cfparam name="Form.enddate" default="#dateformat(now()-1, 'mm/dd/yyyy')#">
<cfparam name="Form.selectdate" default="#dateformat(now(), 'mm/dd/yyyy')#">
<strong>PARA INICIAL LA CONSULTA</strong></p>
<p> </p>
<cfform action="c_mulrange_2.cfm" name="form1" format="Flash" skin="haloBlue" width="375" height="350" >
<cfcalendar name="selectedDate"
selectedDate="#Form.selectdate#"
startRange="#Form.startdate#"
endRange="#Form.enddate#"
mask="mm/dd/yyyy"
dayNames="D,L,M,M,J,V,S"
monthNames="ENE, FEB, MAR, ABR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DIC"
style="rollOverColor:##FF0000"
width="200" height="150">
<cfinput type="dateField" name="startdate" label="FECHA DE INICIO"
width="100" value="#Form.startdate#">
<cfinput type="dateField" name="enddate" label="FECHA FINAL" width="100"
value="#Form.enddate#">
<!--cfinput type="dateField" name="selectdate" label="Initial date" width="100"
value="#Form.selectdate#"-->
<cfinput type="Submit" name="submitit" value="CONSULTAR" width="100">
</cfform>
Copy link to clipboard
Copied
The mask attribute of cfcalendar allows you to specify the format.
Copy link to clipboard
Copied
im having real trouble with this...
<cfparam name="Form.selectdate" default="#dateformat(now(),'dd/mm/yyyy')#">
today is December 11 of 2009 (12/11/09), i change the mask to dd/mm/yyyy and it should be "11/12/09" but the calendar shows NOVEMBER 12 of 2009.
<cfcalendar name="selectedDate"
selectedDate="#Form.selectdate#"
startRange="#Form.startdate#"
endRange="#Form.enddate#"
mask="dd/mm/yyyy" ------------------------------------------------------------------------------------->>> THIS IS HOW I WANT IT!! AND IT SHOW ME OTHER...
dayNames="D,L,M,M,J,V,S"
monthNames="ENE, FEB, MAR, ABR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DIC"
style="rollOverColor:##FF0000"
width="200" height="150">
DO I HAVE BEEN MISSING SOMETHIN?
Copy link to clipboard
Copied
Hi,
Use the "dateformat" functions in your value attribute...
<cfinput
type="dateField"
name="startdate"
label="FECHA DE INICIO"
width="100"
value="#DateFormat(Form.startdate,'DD/MM/YYYY')#"
/>
<cfinput
type="dateField"
name="enddate"
label="FECHA FINAL"
width="100"
value="#DateFormat(Form.enddate,'DD/MM/YYYY')#"
/>
Copy link to clipboard
Copied
today is December 11 of 2009 (12/11/09), i change the mask
to dd/mm/yyyy and it should be "11/12/09" but the calendar
shows NOVEMBER 12 of 2009.
Check your Locale. The current locale determines how the dates are interpreted:
<cfdump var="#GetLocale()#" />
Yours is probably "English (US)". So the date string will be interpreted as a U.S. date (MM/DD/YYYY). Change the locale to something that uses a European style date (DD/MM/YYYY).
Example:
<cfset setLocale("Spanish (Standard)") />
<cfcalendar name="selectedDate"
selectedDate="#Form.selectdate#"
... rest of settings
/>
-Leigh
-Leigh