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

Formatting date cfgrid

New Here ,
Feb 25, 2011 Feb 25, 2011

Using ColdFusion 9 and SQL Server 2008. Have cfgrid with dates. The date columns are not displayed but text boxes are bound to those columns and are displayed. The SQL Server data types are datetime which store in this format - mm/dd/yyyy hh:mm:ss. The cfgrid displays the date as

2011-01-20 14:52:32.167. In the cfgrid code I have tried "mask" and "number format" and neither alter the date display. Any suggestions?

Could I possibly change the format in the text boxes. I use the data in the text boxes for emails and a more conventional date presentation would better suit the email.

Thank you - JS

sample code for cfgrid

<cfgrid name="reqInfo" query="Req" width="510" visible="yes" format="html" rowheaders="yes" rowheaderwidth="50" selectcolor="orange" selectmode="row" maxrows="25" colheaderbold="yes" colheadertextcolor="Blue" selectOnLoad="no">
  <cfgridcolumn name="ID" width="8" display="no" />
  <cfgridcolumn name="PIN" display="no" />
  <cfgridcolumn name="Name" header="Name" headerfontsize="14px" width="150" />
  <cfgridcolumn name="RequestDate" header="Request Date" dataalign="center" headerfontsize="14px" width="115" mask="mm/dd/yyyy" />
  <cfgridcolumn name="BeginDate" header="Begin Date" display="no" headerfontsize="14px" width="90" numberformat="mm/dd/yyyy" />

There's more but this gets the point across.

2.0K
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
New Here ,
Feb 25, 2011 Feb 25, 2011

Found the answer for cfgrid date formatting when format is html. Enter mask="mm/dd/yyyy" and immediately after that enter type="date".

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
Feb 14, 2017 Feb 14, 2017

Hi,

We have a cfgrid with date column

the date column is not getting sorted in date format.it is getting sorted in string format.we are using the following mask= "y-m-d" type="date"

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
Community Expert ,
Feb 14, 2017 Feb 14, 2017
LATEST

@Girishk55972628, this thread is old and is on formatting; your question is on sorting. You should start a new thread.

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