...
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
@@ -10,6 +11,19 @@ namespace Shared
|
||||
{
|
||||
public static class ExMethod
|
||||
{
|
||||
public static string ShamciToFormatShamciinFront(this string str)
|
||||
{
|
||||
if (string.IsNullOrEmpty(str)) return "";
|
||||
return str.Substring(0, 4) + "/" + str.Substring(4, 2) + "/" + str.Substring(6, 2);
|
||||
}
|
||||
public static string ConvertMiladiToShamsiinFront(this DateTime date)
|
||||
{
|
||||
PersianCalendar PersianCal = new PersianCalendar();
|
||||
return PersianCal.GetYear(date).ToString("0000") +
|
||||
PersianCal.GetMonth(date).ToString("00") +
|
||||
PersianCal.GetDayOfMonth(date).ToString("00")
|
||||
;
|
||||
}
|
||||
public static string GetEnumDisplayName(this Enum enumType)
|
||||
{
|
||||
return enumType.GetType().GetMember(enumType.ToString())
|
||||
|
Reference in New Issue
Block a user