HTML cfgrid or SQL date format

I am trying to format dates in HTML cfgrid. I cannot get it to work in CF when using HTML as the grid type. I also tried to do this in MSSQL using - CONVERT (VARCHAR (10), startDate, 101) AS startDate.

When I do this, it is displayed right in the grid, but the grid will not sort by date properly.

I understand why converting it to varchar spins sorting, but I can't get this to work in either CF or SQL.

Does anyone know a way to make it appear in the grid in the format mm / dd / yyyy, and also correctly sort the date?

+4
source share
3 answers

CF9 adds the ability to use the mask attribute in html networks. To make it work with dates, you also need to specify type = date

<cfgridcolumn mask="m/d/Y" type="date" ... > 
+4
source

If you are using html cfgrid, you need to use the formats found in the Ext JS Date class. NOT a date format for Flash.

Here is the link to the Ext JS Date class

+2
source
 <cfgridcolumn ... mask="mm/dd/yy"> 

a source

0
source

Source: https://habr.com/ru/post/1338736/


All Articles