We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Problem with UTC

Thread ID:

Created:

Updated:

Platform:

Replies:

120306 Sep 18,2015 03:32 PM Sep 23,2015 07:31 AM JavaScript 3
loading
Tags: ejGrid
Cristiano Souza Silva
Asked On September 18, 2015 03:32 PM

My application has a problem about UTC. 
I live in Brazil and UTC here is -03:00. 

Always ejGrid show my date with wrong values, basically It get date value and ejGrid sum with -03:00. But I already insert on database with correct value.

The problem just happen with ejGrid. If I get the value and put on MVC Helper, works fine.


Picture 1: Sql Server store value
Picture 2: MVC Helper showing value
Picture 3: ejGrid showing wrong value


Grid

<div id="Grid" data-bind="ejGrid: {

     dataSource: dataSource,

     columns: column,

     toolbarSettings: {

        showToolbar: true,

        customToolbarItems: [{ templateID: '#ToolbarButtonNew' }, { templateID: '#StatusRender' }],

        toolbarItems: [ej.Grid.ToolBarItems.PrintGrid, ej.Grid.ToolBarItems.ExcelExport]

     },     

     allowSorting: true,

     allowPaging: true,     

     allowFiltering: true,

     filterSettings: { filterType: 'menu', filteredColumns: [{ field: 'Status', operator: 'equal', value: '1', predicate: 'and' }] },

     allowGrouping: true,

     allowTextWrap: true,

     create: 'create',

     locale: 'pt-BR',     

     queryCellInfo: 'querycellinfo',

     sortSettings: { sortedColumns: [{ field: 'DeliveryDate', direction: ej.sortOrder.Ascending }]},

     toolbarClick: function (e) {

        this.exportGrid = this['export'];

        if (e.itemName == 'Excel Export') {

            this.exportGrid('/Servicos/OrdemServico/ExcelExport')

             e.cancel = true;

        }

    }

}">

                </div>




window.baseView = {

                dataSource: ej.DataManager({ url: '@Url.Action("KODataSource")', adaptor: "UrlAdaptor" }),

                column: [

                          { headerText: "Ações", template: true, templateID: '#CustomCommand', width: '12%' },

                          { field: "Id", headerText: "Código" },

                          { field: "CustomerId", foreignKeyField: "Id", foreignKeyValue: "Name", dataSource: listCustomers , headerText: "Clientes" },

                          { field: "CreationDate", headerText: "Prazo Criação", format: "{0:dd/MM/yyyy HH:mm}" },

                          { field: "DeliveryDate", headerText: "Data de Entrega", format: "{0:dd/MM/yyyy HH:mm}" },

                          { field: "EmployeeExecutionId", foreignKeyField: "Id", foreignKeyValue: "Name", dataSource: listExecutor, headerText: "Executor" },

                          { field: "TotalPrice", headerText: "Valor Total", format: "{0:c}" },

                          { field: "DescriptionStatus", headerText: "Pendencias", allowFiltering:false }

                ]

            };


            ko.applyBindings(baseView);



DataSource

[AcceptVerbs(HttpVerbs.Post)]

        public ActionResult KODataSource(DataManager clsDataManager)

        {

            BaseResult<WorkOrder> clsData = WorkOrderBusiness.GetAllWithBaseRelations(clsDataManager);


            ResultModel result = new ResultModel();

            result.result = clsData.Result;

            result.count = clsData.Count;


            return Json(result, "application/json", Encoding.Default, JsonRequestBehavior.AllowGet);

        }


Attachment: Pictures_c8903ec8.zip

Isuriya Rajan [Syncfusion]
Replied On September 21, 2015 11:37 AM

Hi Cristiano,
Thanks for contacting Syncfusion support,
In Sql server, Date are in UTC format .To bind data to grid, we have use UrlAdaptor. At the time of binding, data are passed from server to client before date rendered in grid. Datamanager process this data and convert to javascript date object (local date) to apply formatting to date columns in grid. We recommend you to remove format property from column and check grid.
If the above solution not works then could you please provide below details

1)      Screen shot of grid after format property is removed.

2)      Screen shot of data transfer from server to client from developer tool. For example please find the below image.


Regards,
Isuriya R


Cristiano Souza Silva
Replied On September 21, 2015 03:59 PM

Didn't work. 

The data stored on Sql Server is OK.
The data retrieved on JSON handled by server is OK.
The data instance on ejGrid is not OK. 

On file ejgrid-instance-data.png you can see the problem about ejGrid Instance.

Thank you for your help.

Attachment: results_f04ed26.zip

Isuriya Rajan [Syncfusion]
Replied On September 23, 2015 07:31 AM

Hi Cristiano, 


We considered this “UTC date is changed while using the ejGrid” as an issue and a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates. 

https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents 

Regards, 

Isuriya R


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;