CalendarDate class

A universal calendar date that supports multiple calendar systems.

Wraps a Gregorian DateTime and optionally includes lunar and Islamic calendar representations, along with metadata such as solar terms, festivals, and holiday information.

Constructors

CalendarDate({required DateTime gregorian, LunarDate? lunar, IslamicDate? islamic, bool isToday = false, bool isWeekend = false, bool isHoliday = false, String? holidayName, String? solarTerm, String? lunarFestival, String? zodiac})
CalendarDate.fromDateTime(DateTime date)
Creates a CalendarDate from a DateTime, automatically computing lunar calendar data, solar terms, and festival information.
factory

Properties

gregorian DateTime
The Gregorian (standard) date.
final
hashCode int
The hash code for this object.
no setterinherited
holidayName String?
The name of the holiday, if applicable.
final
isHoliday bool
Whether this date is a public holiday.
final
islamic IslamicDate?
The Islamic (Hijri) calendar date, if available.
final
isToday bool
Whether this date is today.
final
isWeekend bool
Whether this date falls on a weekend (Saturday or Sunday).
final
lunar LunarDate?
The Chinese lunar calendar date, if available.
final
lunarFestival String?
The Chinese lunar festival name, if applicable.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
solarTerm String?
The solar term name (e.g. "Spring Equinox"), if this date falls on one.
final
zodiac String?
The Chinese zodiac animal for this year.
final

Methods

copyWith({bool? isHoliday, String? holidayName}) CalendarDate
Returns a copy with updated holiday information.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited