PDA

View Full Version : What are the format options for dateRenderer?



shauntune
6 Sep 2007, 2:12 PM
Hi,

Anyone have any ideas what the options are for formatting a date using Ext.util.Format.dateRenderer?

The API document only says:

dateRendererpublic function dateRenderer(String format)
Returns a date rendering function that can be reused to apply a date format multiple times efficiently
Parameters:

format : String
Any valid date format string
Returns:

Function
The date formatting function
This method is defined by Format.

Valid according to whom? I see Y-m-d works, what about short month names, long month names, AM/PM,etc. Anyone have a list?

Thanks!
Shaun

catacaustic
6 Sep 2007, 3:34 PM
the dateRender function takes in a format string that is based on PHP's date formatting options. To find all of these, have a look at http://www.php.net/manual/en/function.date.php All the options are there

mystix
6 Sep 2007, 10:50 PM
the dateRender function takes in a format string that is based on PHP's date formatting options. To find all of these, have a look at http://www.php.net/manual/en/function.date.php All the options are there

actually, Ext's "date parsing and format syntax is a subset of PHP's date() function, and the formats that are supported will provide results equivalent to their PHP versions". (taken from the Date docs). i.e not all PHP parsing/formatting syntax is available in Ext

if you're using the PHP docs as a reference, you'll need to make sure the equivalent Ext syntax exists before attempting to use it. (The current Ext Date docs shows the list of formatting options that are available).

shauntune
7 Sep 2007, 5:54 AM
Perfect, the list in the 1.1 Date API is just what I was looking for. Thanks for the help all!!!