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:
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] }
});
}
[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);
};
}