1. #1
    Ext User
    Join Date
    Jun 2007
    Posts
    1
    Vote Rating
    0
    mharkus is on a distinguished road

      0  

    Default Render a Date field

    Render a Date field


    Hi all,

    I have an xml which returns a date in format 2007-06-04 14:47:00.0 and I tried using:

    Code:
    renderer:  Ext.util.Format.dateRenderer('Y-m-d H:i:s')
    but the grid shows NaN. I hope somebody can help me.

    Thanks,
    Marc

  2. #2
    Ext User
    Join Date
    May 2007
    Posts
    3
    Vote Rating
    0
    simonspitz is on a distinguished road

      0  

    Default Here is a possible solution

    Here is a possible solution


    I had the same going on with Json Data and I came up with that little gizmo:

    PHP Code:
    function renderDate(value){
        var 
    dt = new Date();
        
    dt =  Date.parseDate(value"Y-m-d h:i:s");
        return 
    dt.format('d.m.Y H:i:s');
    }

    var 
    cm = new Ext.grid.ColumnModel(
      [
        {
    header'Date'sortabletruedataIndex'somedate'rendererrenderDate},
        .....
      ]
    ); 
    ... or the short form:

    PHP Code:
    function renderDate(value){
        return 
    Date.parseDate(value,"Y-m-d h:i:s").format('d.m.Y H:i:s');

    cheers

  3. #3
    Sencha User
    Join Date
    Apr 2010
    Location
    Bandung, West Java, Indonesia
    Posts
    15
    Vote Rating
    0
    novaku is on a distinguished road

      0  

    Default thanks

    thanks


    excelent simonspitz, that's what i looking for all night...
    at last i found it.....

    mmmhh... wonder what could i give to you to bring back the favor
    but any way thanks mate..

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi