LunarDateTime class

Represents a date and time in the Lunar calendar.

This class provides methods to work with Lunar dates, such as obtaining the Stem-Branch combination for the year, month, day, and hours, checking lucky hours, checking if it's a lucky day, and more.

Example usage:

LunarDateTime lunarDate = LunarDateTime(year: 2000, month: 12, day: 12);
print('Stem-Branch of the year: ${lunarDate.stemBranchOfYear.name(LanguageName.vietnamese)}');
print('Stem-Branch of the month: ${lunarDate.stemBranchOfMonth.name(LanguageName.vietnamese)}');
print('Stem-Branch of the day: ${lunarDate.stemBranchOfDay.name(LanguageName.vietnamese)}');
print('Stem-Branch of "Mouse hour": ${lunarDate.listStemBranchOfHour[0].name(LanguageName.vietnamese)}');
print('List of lucky hours: ${lunarDate.listLuckyHours}');
print('Is it a lucky day? ${lunarDate.isLuckyDay}');

Constructors

LunarDateTime({required int year, required int month, required int day, bool isLeap = false, int timeZone = 7})
Constructs a LunarDateTime with the provided year, month, day, leap status, and timeZone.

Properties

day int
final
hashCode int
The hash code for this object.
no setterinherited
isLeap bool
final
isLuckyDay bool
Checks if the Lunar date is a lucky day.
no setter
listLuckyHours List<bool>
Generates a list of lucky hours of this date.
no setter
listStemBranchOfHour List<StemBranch>
Generates a list of Stem-Branch combinations for each hour of this date. This list has 12 elements equivalent to 12 branches from Mouse to Pig.
no setter
month int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stemBranchOfDay StemBranch
Gets the Stem-Branch combination for the day.
no setter
stemBranchOfMonth StemBranch
Gets the Stem-Branch combination for the month.
no setter
stemBranchOfYear StemBranch
Gets the Stem-Branch combination for the year.
no setter
timeZone int
final
year int
final

Methods

getDateNext(int rangeDays) LunarDateTime
Get the Lunar Date after rangeDays You can pass the negative for date before.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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