PDA

View Full Version : How to format a Date?



smartlit
15 May 2008, 7:23 AM
Hello,

I need to display a label with a date/time. I get this information from a SQL database.

How can I format the label so that it displays correctly according to current settings? For example, if the user is in the US it should display:

May 15, 2008

If in the Uk it should display:

15 May 2008

Thanks,

Paul

mystix
15 May 2008, 9:17 AM
js file include order


ext-base.js
ext-all.js
ext-lang-xxx.js // ext locale file


and when declaring your fieldLabel config


...
fieldLabel: Ext.util.Format.date(sqlDateString) // assuming your sqlDateString is in some sane format
...