jQWidgets Forums

jQuery UI Widgets Forums Grid Date Format from Calendar in Grid

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

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Date Format from Calendar in Grid #56466

    Gopre400
    Participant

    Hi, I am using a jqxcalendar in a grid and passing the data to WebService via .ajax. However the date format returned from the calendar is not recognized as a valid Date in VB.net.

    This is what is being returned from jqxCalendar…”Thu Jun 26 2014 00:00:00 GMT-0700 (Pacific Daylight Time)”

    Is there a way to convert this to a different format?

    Date Format from Calendar in Grid #56478

    Peter Stoev
    Keymaster

    Hi Gopre400,

    The Calendar/DateTimeInput returns a JavaScript Date Object – http://www.w3schools.com/jsref/jsref_obj_date.asp. What you pasted here is the result of your Date object’s toString() method call. If you want to format a JavaScript Date object in a format of your choice, you can use the dataAdapter’s formatDate method.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Date Format from Calendar in Grid #56510

    Gopre400
    Participant

    Thank you Peter!

    Here is what I did, which worked great.

    updaterow: function (rowid, rowdata, commit) {
    var sdate = dataAdapter.formatDate(rowdata.ScheduledDate, ‘D’);
    $.ajax({
    type: “POST”,
    url: “CSWebService.asmx/UpdateCSProject”,
    contentType: “application/json; charset=utf-8”,
    dataType: “json”,
    data: ‘{“projectid”:”‘ + rowdata.ProjectID + ‘”,”roadname”:”‘ + rowdata.RoadName + ‘”,”roadnumber”:”‘ + rowdata.RoadNumber + ‘”,”fromdesc”:”‘ + rowdata.FromDesc + ‘”,”todesc”:”‘ + rowdata.ToDesc + ‘”,”frommp”:”‘ + rowdata.FromMP + ‘”,”tomp”:”‘ + rowdata.ToMP + ‘”,”projstatus”:”‘ + rowdata.ProjectStatus + ‘”,”sdate”:”‘ + sdate + ‘”}’,
    success: function (data) {
    commit(true);
    GetItems()
    }
    });
    },

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

You must be logged in to reply to this topic.