Skip to main content
Participating Frequently
July 2, 2013
Question

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

  • July 2, 2013
  • 1 reply
  • 1057 views

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?

This topic has been closed for replies.

1 reply

BKBK
Community Expert
Community Expert
July 21, 2013

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>