C# Class PdfRpt.Core.Helper.PersianDate

Persian Date Converter
Afficher le fichier Open project: VahidN/PdfReport

Méthodes publiques

Méthode 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 méthode

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
Résultat int

FixWeakCharacters() public static méthode

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
Résultat string

HijriToGregorian() public static méthode

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
Résultat void

IsLeapYear() public static méthode

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

ToPersianDateTime() public static méthode

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 :
Résultat string