Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Lonnie on Jun 19, 2007 16:38
open dhtmlx forum
dhtmlxGrid and date column formatting

We would like to be able to output dates with options like the weekday (full name and abbreviated), the month name (full and abbreviated), and various time formats(12 and 24 hour based).  Ideally we would output the column as a uniform date/time string so that the default date sorting works without defining possibly slow custom sort routines, and then use the format for the display.  However, the format option seems to be limited to m, d and y for the numeric components of the date.  Are there any changes coming soon to date formatting?
Answer posted on Jun 20, 2007 15:35
You can check attached sample - it is an alternative calendar excell, which planed to be released with next build.
In supports extended date formating

%e   Day of the month without leading zeros (01..31)
%d   Day of the month, 2 digits with leading zeros (01..31)
%j   Day of the year, 3 digits with leading zeros (001..366)
%a   A textual representation of a day, three letters
%W   A full textual representation of the day of the week

%c   Numeric representation of a month, without leading zeros (0..12)
%m   Numeric representation of a month, with leading zeros (00..12)
%b   A short textual representation of a month, three letters (Jan..Dec)
%M   A full textual representation of a month, such as January or March (January..December)

%y   A two digit representation of a year (93..03)
%Y   A full numeric representation of a year, 4 digits (1993..03)

Attachments (1)
3.ZIP64.74 Kb
Answer posted by Chuan on Aug 29, 2007 15:46
I tried this sample but when I click http://localhost/dhtmlxGrid_calendar/samples/pro_excell_calendar_input.html#" onclick="mygrid.clearAll(); mygrid.setDateFormat('%Y - %d/%m'); mygrid.loadXML('grid_calendar2.xml'); ">Reload with "YYYY - M/D" format", it give me this error:

Error: mygrid.setDateFormat is not a function
Source File: http://localhost/dhtmlxGrid_calendar/samples/pro_excell_calendar_input.html#
Line: 1
Answer posted by Chuan on Aug 29, 2007 15:48
I tried this sample but when I click http://localhost/dhtmlxGrid_calendar/samples/pro_excell_calendar_input.html#" onclick="mygrid.clearAll(); mygrid.setDateFormat('%Y - %d/%m'); mygrid.loadXML('grid_calendar2.xml'); ">Reload with "YYYY - M/D" format", it give me this error:

Error: mygrid.setDateFormat is not a function
Source File: http://localhost/dhtmlxGrid_calendar/samples/pro_excell_calendar_input.html#
Line: 1
Answer posted by Chuan on Aug 29, 2007 20:00
I tried this sample but when I click http://localhost/dhtmlxGrid_calendar/samples/pro_excell_calendar_input.html#" onclick="mygrid.clearAll(); mygrid.setDateFormat('%Y - %d/%m'); mygrid.loadXML('grid_calendar2.xml'); ">Reload with "YYYY - M/D" format", it give me this error:

Error: mygrid.setDateFormat is not a function
Source File: http://localhost/dhtmlxGrid_calendar/samples/pro_excell_calendar_input.html#
Line: 1
Answer posted by Darya (Support) on Dec 06, 2014 22:27

To find more precise comments upon this issue, we can offer you read about website components and component library.