Exemplo n.º 1
0
 public PersianDateTime Parse(object value)
 {
     if (value is string)
     {
         string          stringValue = (string)value;
         PersianDateTime dt;
         if (!PersianDateTime.TryParse(stringValue, out dt))
         {
             return(null);
         }
         return(dt);
     }
     else if (value is long)
     {
         long longValue = (long)value;
         if (longValue == 0)
         {
             return(null);
         }
         return(PersianDateTime.FromLong(longValue));
     }
     return(null);
 }
 public static MvcHtmlString AsDateString(this long value, string fromat)
 {
     return(MvcHtmlString.Create(PersianDateTime.FromLong(value).ToString(fromat)));
 }
 public static MvcHtmlString AsReverseDateString(this long value)
 {
     return(MvcHtmlString.Create(PersianDateTime.FromLong(value).ToReverseDateString()));
 }