C# Class PdfRpt.Core.Helper.PersianDate

Persian Date Converter
显示文件 Open project: VahidN/PdfReport

Public Methods

Method Description
Find1StDayOfMonth ( int year, int monthIndex, CalendarType calendarType = CalendarType.PersianCalendar ) : int

Finds 1st day of the given year and month.

FixWeakCharacters ( this data ) : string

If you see dd/mm/yyy instead of yyyy/mm/dd in your RTL reports, use this method to fix it.

HijriToGregorian ( int inYear, int inMonth, int inDay, int &outYear, int &outMonth, int &outDay ) : void

Converts Hijri date To Gregorian date.

IsLeapYear ( this year, CalendarType calendarType = CalendarType.PersianCalendar ) : bool

Is a given year leap?

ToPersianDateTime ( this gregorianDate, string dateSeparator = "/", bool includeHourMinute = true, bool showLeftAlignedHourMinute = true, string timeSeparator = ":" ) : string

Converts Gregorian date to Shamsi/Persian date

Method Details

Find1StDayOfMonth() public static method

Finds 1st day of the given year and month.
public static Find1StDayOfMonth ( int year, int monthIndex, CalendarType calendarType = CalendarType.PersianCalendar ) : int
year int
monthIndex int
calendarType CalendarType
return int

FixWeakCharacters() public static method

If you see dd/mm/yyy instead of yyyy/mm/dd in your RTL reports, use this method to fix it.
public static FixWeakCharacters ( this data ) : string
data this string data
return string

HijriToGregorian() public static method

Converts Hijri date To Gregorian date.
public static HijriToGregorian ( int inYear, int inMonth, int inDay, int &outYear, int &outMonth, int &outDay ) : void
inYear int
inMonth int
inDay int
outYear int
outMonth int
outDay int
return void

IsLeapYear() public static method

Is a given year leap?
public static IsLeapYear ( this year, CalendarType calendarType = CalendarType.PersianCalendar ) : bool
year this
calendarType CalendarType
return bool

ToPersianDateTime() public static method

Converts Gregorian date to Shamsi/Persian date
public static ToPersianDateTime ( this gregorianDate, string dateSeparator = "/", bool includeHourMinute = true, bool showLeftAlignedHourMinute = true, string timeSeparator = ":" ) : string
gregorianDate this Gregorian date
dateSeparator string Defines an optional separator between date's parts. Its default value is /
includeHourMinute bool Should converter include hour and minutes in final result. Its default value is true
showLeftAlignedHourMinute bool If includeHourMinute is true, indicates whether to show hh:mm yyyy/mm/dd or yyyy/mm/dd hh:mm
timeSeparator string Defines an optional separator between time's parts. Its default value is :
return string