Jalali class

Jalali (Shamsi or Persian) Date class

Implemented types

Constructors

Jalali(int year, [int month = 1, int day = 1])
Create a Jalali date by using year, month and day year and month default to 1 year, month and day can not be null [...]
Jalali.fromDateTime(DateTime dateTime)
Create a Jalali date by using DateTime object [...]
factory
Jalali.fromGregorian(Gregorian date)
Create a Jalali date from Gregorian date [...]
factory
Jalali.fromJulianDayNumber(int julianDayNumber)
Converts the Julian Day number to a date in the Jalali calendar. [...]
factory
Jalali.now()
Get Jalali date for now [...]
factory

Properties

day int
Jalali day (1 to 29/31) [...]
final
formatter JalaliFormatter
Formatter for this date object [...]
read-only, override
hashCode int
hashCode operator [...]
read-only, override
julianDayNumber int
Converts a date of the Jalali calendar to the Julian Day number. [...]
read-only, override
month int
Jalali month (1 to 12) [...]
final
monthLength int
Computes number of days in a given month in a Jalali year. [...]
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
weekDay int
Week day number Shanbe = 1 Jomee = 7 [...]
read-only, override
year int
Jalali year (1 to 3100) [...]
final

Methods

add({int years: 0, int months: 0, int days: 0}) Jalali
add days, months and years separately note: it does not make any conversion, it simply adds to each field value for subtracting simple add negative value [...]
addDays(int days) Jalali
add days to this date this Method is safe [...]
addMonths(int months) Jalali
add months to this date this Method is safe for month and year bounds [...]
addYears(int years) Jalali
add years to this date [...]
compareTo(Jalali other) int
Compare dates [...]
override
copy({int year, int month, int day}) Jalali
Copy this date object with some fields changed [...]
isLeapYear() bool
Checks if a year is a leap year or not. [...]
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toDateTime() DateTime
Converts Jalali date to DateTime object [...]
toGregorian() Gregorian
Converts a Jalali date to Gregorian. [...]
toString() String
Default string representation: Jalali(YYYY,MM,DD). use formatter for custom formatting. [...]
override
withDay(int day) Jalali
changes day [...]
withMonth(int month) Jalali
changes month [...]
withYear(int year) Jalali
changes year throws if year is null

Operators

operator +(int days) Jalali
add days this Method is safe [...]
operator -(int days) Jalali
subtract days this Method is safe [...]
operator <(Jalali other) bool
less than operator [...]
operator <=(Jalali other) bool
less than or equal operator [...]
operator ==(Object other) bool
equals operator [...]
override
operator >(Jalali other) bool
bigger than operator [...]
operator >=(Jalali other) bool
bigger than or equal operator [...]

Static Properties

MAX Jalali
Maximum computable Jalali date [...]
final
MIN Jalali
Minimum computable Jalali date [...]
final