HDate class
HDate models a date (day in year) tag value.
See Project Haystack
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
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 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