jQWidgets Forums

jQuery UI Widgets Forums General Discussions Editors DateTimeInput setting the correct format for Database mySql

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • rustyfile
    Member

    I have tried several different date formats to save the date into mysql database as “yyyy-MM-dd” and it wont work.
    I have changed the field col in mysql as text and it inserts the long date time as a string.
    What am I doing wrong here?
    This is what I have,

    {text: ‘Date’, datafield: ‘date1’, columntype: ‘datetimeinput’, width: 200, align: ‘right’, cellsalign: ‘left’, cellsformat: ‘yyyy-MM-dd’,
    validation: function (cell, value) {
    if (value == “”)
    return true;
    var year = value.getFullYear();

    if (year >= 2014) {
    return { result: false, message: “Date should be before 1/1/2014” };
    }
    return true;
    }
    },


    Peter Stoev
    Keymaster

    Ho rustyfile.

    If you wish to get the displayed cell text, then you may use the Grid’s “getcelltext” method of jqxGrid. That text will be in the format specified by the “cellsformat” property.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.