intl_local/lib/src/intl/date_computation library

Functions

dayOfYear(int month, int day, bool leapYear) → int
Given a month and day number, return the day of the year, all one-based.
isLeapYear(DateTime date) → bool
Return true if this is a leap year. Rely on DateTime to do the underlying calculation, even though it doesn't expose the test to us.
ordinalDayFromMarchFirst(int month, int day) → int
Return the day of the year counting March 1st as 1, after which the number of days per month is constant, so it's easier to calculate. Formula from http://en.wikipedia.org/wiki/Ordinal_date