Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help with dateformat and <cfcalendar> PLZ!...

Guest
Dec 11, 2009 Dec 11, 2009

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.

calendar.JPG

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>

682
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 11, 2009 Dec 11, 2009

The mask attribute of cfcalendar allows you to specify the format.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 11, 2009 Dec 11, 2009

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 11, 2009 Dec 11, 2009

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')#"

/>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Dec 11, 2009 Dec 11, 2009
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources