ordinalDayFromMarchFirst function

int ordinalDayFromMarchFirst (
  1. int month,
  2. int day
)

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

Implementation

int ordinalDayFromMarchFirst(int month, int day) =>
    ((30.6 * month) - 91.4).floor() + day;