1 of 2

Trefoil Date Library

sec09

2 of 2

Add the following date functions to stdlib.trefoil

  • date (struct): Represents a specific date with fields year, month, and day.
    • is-leap-year?: Determines whether a given year is a leap year.
    • days-in-month: Returns the number of days in a given month.
    • add-days: Adds a specified number of days to a date.
    • first-day: Returns the first day of the month for a given date.
    • last-day: Returns the last day of the month for a given date.
    • add-days-to-dates: Adds a specific number of days to each date in a list of dates.

Do we require any new language features?