Skip to main content
Participating Frequently
May 22, 2008
Question

<cfgrid> driving me crazy

  • May 22, 2008
  • 2 replies
  • 627 views
Does anyone know how to reliably format dates in an html cfgrid? I've attached the code I'm using. I need to format the dateadded field in a european dateformat. the moment all I get is the native SQL date format, I won't be able to use cfgrid unless I can sort this out so any help would be most appreciated. I'm kinda pulling my hair out here. I've googled the problem and tried various scripting ideas but nothing works 😞 This seems like such a basic thing I'm suprised there's no easy solution.



This topic has been closed for replies.

2 replies

Inspiring
May 23, 2008
you can also use your db's date functions to format your date column as
you need in your query...

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
Participating Frequently
May 22, 2008
See the docs - http://www.cfquickdocs.com/#cfgridcolumn

Try using the type attribute - (type="date") along with a mask attribute (mask="DD/MM/YYYY") that should get you going.
jumperBAuthor
Participating Frequently
May 23, 2008
Thanks, I tried that one but it only seems to work when the form is flash. One of the requirements of this project is no flash anywhere so that one is out. I don't understand why the "mask" attribute doesn't work in html format grids but that is probably down to the integration with EXT. The more I look at it the more it feels like this component of CF is half-finished.
jumperBAuthor
Participating Frequently
May 23, 2008
Thanks for all your help guys but I've decided to try a different solution. cfgrid is obviously not designed to do what I want to do with it and trying to make it look the way I want is proving impossible. Things like default underlining of linked rows and other limitations including the date formatting mean that I am wasting way too much time on this. I gave the client timescales based on an initial assesment of the tag. Unfortunately that assesment didn't try to push too many boundries and the actual capabilities of the tag are rather pitiful. I don't have time to start hacking loads of css and javascript. I'm hoping adobe will improve the tag because at the moment it's pretty useless. Any cf tag you need to hack to make it do what you want is, in my opinion, incomplete and should not be included in a production release of Cold Fusion.