Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there ,

I am using jqgrid to display my records.Below is link from which I have followed the implemnetation.

Jqgrid documentation version link 
http://versions.gijgo.com/0_4/Documentation/Grid


But now the problem is that , as per timezone my date and timings are getting displayed differntly . I want user to display exact value at what time I have save.

What I have tried:

function ReportedCallLoadData() {
    grid = $("#grid").grid({
        dataKey: "ID",
        uiLibrary: "bootstrap",
        columns: [
            { field: "ClientName", title: "Client Name", sortable: true },
            { field: "StartTime", title: "Start Time", sortable: true, type: 'date', format: 'dd/mm/yyyy hh:MM TT' },
            { field: "EndTime", title: "End Time", sortable: true, type: 'date', format: 'dd/mm/yyyy hh:MM TT' },
            { field: "ActualDate", title: "Actual Date", sortable: true, type: 'date', format: 'dd/mm/yyyy' },
            { field: "CreatedOn", title: "Created On", sortable: true, type: 'date', format: 'dd/mm/yyyy hh:MM TT' },
            { title: "", field: "Edit", width: 34, type: "icon", icon: "glyphicon-pencil", tooltip: "Edit", events: { "click": Edit } },
            { title: "", field: "Delete", width: 34, type: "icon", icon: "glyphicon-remove", tooltip: "Delete", events: { "click": DisplayDeleteCommentsBox } }
        ],
        pager: { enable: true, limit: 5, sizes: [2, 5, 10, 20] }
    });
}



C#
[HttpGet]
       [Authorize]
       public JsonResult GetCallDetails(int? page, int? limit, string sortBy, string direction,
           string mrID, string date, string isChemist, string searchString = null)
       {
           date = string.IsNullOrEmpty(date) ? DateTime.Now.Date.ToString("dd/MM/yyyy") : date;
           var actualFilterDate = DateTime.ParseExact(date, "dd/MM/yyyy", null);

           FilterBO objFilter = new FilterBO()
           {
               Page = page,
               Limit = limit,
               SortBY = sortBy,
               Direction = direction,
               SearchString = searchString,
               UserId = !string.IsNullOrEmpty(mrID) ? Convert.ToInt32(mrID) : 0,
               IsChemist = Convert.ToBoolean(isChemist),
               ActualDate = actualFilterDate,
           };

           int total = 0;

           if (objFilter.IsChemist)
           {
               objChemistCalls = new ChemistCallRepository();
               var records = objChemistCalls.GetCallDetails(objFilter, out total);
               ViewBag.Header = "Reported Call Details";
               return Json(new { records, total }, JsonRequestBehavior.AllowGet);
           }
           else
           {
               objCalls = new CallsRepository();
               var records = objCalls.GetCallDetails(objFilter, out total);
               ViewBag.Header = "Reported Chemist Call Details";
               return Json(new { records, total }, JsonRequestBehavior.AllowGet);
           };
       }
Posted
Updated 7-Apr-20 5:33am

1 solution

Hi: I know this is an old post but was checking to see if there is a solution. I'm currently experiencing the exact same issue.
 
Share this answer
 
Comments
CHill60 7-Apr-20 12:23pm    
"checking to see if there is a solution" - well there is now because you just posted a comment as a solution. If you want to post a question or comment then click the "Have a Question or Comment?" link. Don't click the "Add a Solution" link or start typing in the "Add your solution here" box - it couldn't be any clearer that those are for solutions not questions

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900