HDate class

HDate models a date (day in year) tag value.

See Project Haystack

Inheritance

Constructors

HDate(int year, int month, int day)
Construct from basic fields
factory
HDate.fromDateTime(DateTime dt)
Construct from Dart DateTime instance
factory
HDate.fromString(String s)
Parse from string fomat "YYYY-MM-DD" or raise ParseError
factory

Properties

day int
Day of month as 1-31
final
hashCode int
Hash is based on year, month, day
no setteroverride
month int
Month as 1-12 (Jan is 1, Dec is 12)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
year int
Four digit year such as 2011
final

Methods

compareTo(Object that) int
Returns sort order as negative, 0, or positive
override
encode(StringBuffer s) → void
Package private implementation shared with HDateTime
midnight(HTimeZone tz) HDateTime
Convert this date into HDateTime for midnight in given timezone.
minusDays(int numDays) HDate
Returns date in past given number of days
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
plusDays(int numDays) HDate
Returns date in future given number of days
toJson() String
Encodes as "d:YYYY-MM-DD"
override
toString() String
String format is for human consumption only.
inherited
toZinc() String
Encodes as "YYYY-MM-DD"
override
weekday() int
Returns day of week: Sunday is 1, Saturday is 7

Operators

operator ==(Object that) bool
Equals is based on year, month, day
override

Static Properties

daysInMon List<int>
final
daysInMonLeap List<int>
final

Static Methods

daysInMonth(int year, int mon) int
Returns number of days in given year (xxxx) and month (1-12)
isLeapYear(int year) bool
Returns if given year a leap year
today(HTimeZone tz) HDate
Get HDate for current time in default timezone