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

Using datefield, is there a way for the calendar to display multiple months?

New Here ,
Jul 02, 2013 Jul 02, 2013

Copy link to clipboard

Copied

I've got a couple of cfinput datefields that show the current month when you select the calendar icon. Because these fields are used to select the "From" and "To" dates for reports, I need the calendar to actually show dates in the past. It would be great if one click would show the previous three months.

Can that be done?

Views

1.0K

Translate

Translate

Report

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
Community Expert ,
Jul 21, 2013 Jul 21, 2013

Copy link to clipboard

Copied

LATEST

Why not just put in the date three months ago, as default. Something like this

<cfdump var="#form#">

<cfset dateThreeMonthsAgo = dateformat(dateAdd('m',-3,now()),'dd/mm/yyyy')>

<cfform>

<div>

Date: <cfinput name="dt" type="datefield" value="#dateThreeMonthsAgo#">

</div>

<cfinput type="submit" name="sbmt" value="Send">

</cfform>

Votes

Translate

Translate

Report

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
Documentation