Friday, 15 May 2015

extjs - How to convert Format for Date and Time in Sencha Touch? -



extjs - How to convert Format for Date and Time in Sencha Touch? -

in sencha touch 2 have model next fields, datetimestart if rendered in list shows in format

mon feb 11 2013 11:55:00 gmt +100 (w. europe standard time)

i need create field (datetimestartconverted) based on datetimestart need convert such date in more short format using 'y-m-d'.

printing result of datetimestartconverted in conversion method not display result (no errors has been throw).

any thought how prepare it?

{ name: 'datetimestart', type: 'date', dateformat: 'ms' }, { name: 'datetimestartconverted', type: 'date', convert: function(value, record){ var jsondate = record.get('datetimestart'); homecoming ext.date.format(jsondate, 'y-m-d'); } }

if need display date in list item template, can utilize :date() function within template:

{ xtype: 'list', ... itemtpl: '<p>date display test - {datetimestart:date("m/d/y")}</p>', ... }

as convert function, looks sound, value , record arguments? knowing values help lot.

extjs sencha-touch sencha-touch-2

No comments:

Post a Comment