jQWidgets Forums

jQuery UI Widgets Forums Grid problem with date format

Tagged: 

This topic contains 2 replies, has 2 voices, and was last updated by  gusanomaly 10 years, 3 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • problem with date format #66323

    gusanomaly
    Participant

    Hi,

    I’m using this grid with many colums, in one is width date format seted as format: ‘dd/MM/yyyy’.
    When open the grid width data from database no use the format that I seted, the date format from my database is: yyyy-mm-dd h:i:s

    So, I’ve defined in datafields like this: { name: ‘date_val’, type: ‘date’, format: ‘dd/MM/yyyy’},
    And in grid also put the next: cellsformat: ‘dd/MM/yyyy’

    When i get the data grid using getboundrows and show the data with alert() it show this: Mon Feb 02 2015 00:00:00 GMT-0300

    Thank you and i hope write clearly!
    Gustav.

    problem with date format #66325

    Peter Stoev
    Keymaster

    Hi Gustav,

    The data field’s format should be equal to your DB’s format. The column’s cellsformat should be the format which you want to be displayed. In Grid, dates are JavaScript date Object’s i.e they’re store as Mon Feb 02 2015 00:00:00 GMT-0300. If you want to get the display text of a given cell, use “getcelltext”.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    problem with date format #66358

    gusanomaly
    Participant

    Hi,

    Works perfect!

    Thank you,
    Gustav.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.