CalendarConfig class
Configuration class for the Myanmar Calendar
Constructors
-
CalendarConfig({int sasanaYearType = 0, int calendarType = 0, int gregorianStart = 2361222, double timezoneOffset = 6.5, String defaultLanguage = 'en', List<
CustomHoliday> customHolidays = const [], List<HolidayId> disabledHolidays = const [], Map<int, List< disabledHolidaysByYear = const {}, Map<HolidayId> >String, List< disabledHolidaysByDate = const {}, WesternHolidayProvider westernHolidayProvider = const DefaultWesternHolidayProvider()})HolidayId> > -
Create config with default values
const
- CalendarConfig.ancientMyanmarTime()
-
Create config with Ancient Myanmar Time (UTC+6:24:47)
factory
- CalendarConfig.myanmarTime()
-
Create config with Myanmar Time (UTC+6:30)
factory
Properties
- cacheNamespace → String
-
Cache namespace fingerprint for this configuration.
no setter
- calendarSystem → CalendarSystem
-
calendarType as a CalendarSystem.
no setter
- calendarType → int
-
Calendar type for Julian/Gregorian calculations
final
-
customHolidayRules
→ List<
CustomHoliday> -
Custom holiday rules defined by the consumer.
no setter
-
customHolidays
→ List<
CustomHoliday> -
Custom holidays defined by the consumer
final
- defaultLanguage → String
-
Default language for translations
final
-
disabledHolidays
→ List<
HolidayId> -
List of built-in holidays to disable globally
final
-
disabledHolidaysByDate
→ Map<
String, List< HolidayId> > -
Map of Western date (YYYY-MM-DD) to list of built-in holidays to disable for that specific date
final
-
disabledHolidaysByYear
→ Map<
int, List< HolidayId> > -
Map of Western year to list of built-in holidays to disable for that specific year
final
- gregorianStart → int
-
Beginning of Gregorian calendar in JDN
default=2361222final - hashCode → int
-
The hash code for this object.
no setteroverride
- language → Language
-
defaultLanguage as a Language (English for an unknown code; see
validate).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sasanaYear → SasanaYearType
-
sasanaYearType as a SasanaYearType.
no setter
- sasanaYearType → int
-
Sasana year type
final
- timezoneOffset → double
-
Default timezone offset in hours (e.g., 6.5 for Myanmar Time)
final
- timezoneOffsetInDays → double
-
Get the current timezone offset in days
no setter
- westernHolidayProvider → WesternHolidayProvider
-
Provider for western-calendar holiday rules (e.g., Eid/Diwali/CNY).
final
Methods
-
copyWith(
{int? sasanaYearType, int? calendarType, int? gregorianStart, double? timezoneOffset, String? defaultLanguage, List< CustomHoliday> ? customHolidayRules, List<HolidayId> ? disabledHolidays, Map<int, List< ? disabledHolidaysByYear, Map<HolidayId> >String, List< ? disabledHolidaysByDate, WesternHolidayProvider? westernHolidayProvider}) → CalendarConfigHolidayId> > - Copy with new values
-
localToUtc(
double localJdn) → double - Convert local time to UTC Julian Day Number
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
utcToLocal(
double utcJdn) → double - Convert UTC Julian Day Number to local time
-
validate(
) → void - Throws InvalidConfigurationException for a value outside its range or an unknown defaultLanguage. The constructor only checks these with asserts, which release builds skip.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
- global ↔ CalendarConfig
-
Get the package-wide global configuration
getter/setter pair