Tuesday, October 11, 2011

Show Friendly Dates in Pages

Mostly when displaying null dates it appears in the screen as 1/1/0001. To avoid that we can create a readonly property for Example JOINDATESTRING where

public string JoinDateString
{
   get
  {
       if (StartDate == DateTime.MinValue)
      {
           return String.Empty();
      }
     else
    {
       return StartDate.ToString("dd/MM/yyyy");
    }
 }
}

No comments: