jquery datatables - Return String instead of DateTime if LINQ Query NULL -
I am using JQuery Datatables with my MVC 5 application. I am implementing sorting on any of my datalet within my MVC controller. One of the columns displays the date to the user, and I want them to be able to sort this column, which works fine.
// To sort different types of columns get the index of CollumnInndex = Convert ToInt32 (Request ["iSortCol_0"]); Function & lt; Survey_stats, datetime & gt; OrderingFunctionDate; Ordering FunctionDet = (C => c.InitiatedDate == Zero? Default (DateTime): c.InitiatedDate.Value); The problem is, at the moment, if c.InitiatedDate is zero, then I will change the default date back to 01/01/000 1, otherwise I return the actual date recorded in the database. I do not like that I'm returning to the user 01/01/0001 , this is not great utility and can confuse them The problem is that I
> ordering functionDATE = (C = & Gt; c.InitiatedDate == zero? Default (datetime): c.InitiatedDate.Value); With
Comments
Post a Comment