Kamal Kamal - 6 months ago 26
PHP Question

convert date kendo ui grid

I have Kendo UI grid when I save a new date value, the value send as POST request like


Wed Jun 19 2013 17:48:32 GMT+0200 (Egypt Standard Time)


I am trying to take this value and send to the web service which waiting value with type "DateTime"

I want to convert the sending value date even in Kendo UI before send as POST value or

in the PHP file when I receive this value

Any Help ?

Answer

kendo ui allow set culture and date format adding

please checkout http://docs.kendoui.com/api/framework/kendo#culture

http://docs.kendoui.com/getting-started/framework/globalization/dateformatting

Reading i found this:

http://www.kendoui.com/forums/framework/globalization/kendo-fails-to-parse-or-format-utc-dates.aspx

    parameterMap: function (options, operation) {
                            if (operation != "read") {
                                var d = new Date(options.Date);
                                options.Date = d.toString("yyyy-MM-dd");                            
                                return options;
                            }
                        }
{ field: "Date", title: "Date ", type: "date", format: "{0:dd/MM/yyyy}" }

result : 30/08/2012