(examples-for date ("creates a single date" (to-string (date 1965 6 8)) "1965-06-08" ) ("navigates to next day" (let d (date 2004 3 11) (to-string d.tomorrow)) "2004-03-12" ) ("navigates to previous day" (let d (date 2006 6 22) (to-string d.yesterday)) "2006-06-21" ) ("navigates to previous year" (let d (date 1971 12 18) (to-string d.last-year)) "1970-12-18" ) ("navigates to next year" (let d (date 1974 1 11) (to-string d.next-year)) "1975-01-11" ) ("navigates to previous month" (let d (date 1971 12 18) (to-string d.last-month)) "1971-11-18" ) ("navigates to next month" (let d (date 1974 1 11) (to-string d.next-month)) "1974-02-11" ) ("jumps a year to previous month" (let d (date 1974 1 11) (to-string d.last-month)) "1973-12-11" ) ("navigates to previous week" (let d (date 2008 2 16) (to-string d.last-week)) "2008-02-09" ) ("navigates to next week" (let d (date 1972 11 13) (to-string d.next-week)) "1972-11-20" ) ("navigates to year start" (let d (date 1972 11 13) (to-string d.beginning-of-year)) "1972-01-01" ) ("navigates to year end" (let d (date 1972 11 13) (to-string d.end-of-year)) "1972-12-31" ) ("navigates to month start" (let d (date 1971 11 18) (to-string d.beginning-of-month)) "1971-11-01" ) ("navigates to month end" (let d (date 1971 11 18) (to-string d.end-of-month)) "1971-11-30" ) ("navigates to week start" (let d (date 2015 11 6) (to-string d.beginning-of-week)) "2015-11-02" ) ("navigates to week start from sun" (let d (date 2015 11 1) (to-string d.beginning-of-week)) "2015-10-26" ) ("navigates to week end from sun" (let d (date 2015 11 1) (to-string d.end-of-week)) "2015-11-01" ) ("navigates to week end" (let d (date 2015 11 6) (to-string d.end-of-week)) "2015-11-08" ) ("can act as hash key" (with (h {} d (date 2015 11 8)) (hash-set h d "on this day") (to-string (hash-get h (date 2015 11 8)))) "on this day") ("returns its year" (let d (date 1999 12 31) d.year) 1999) ("returns its month" (let d (date 1999 12 31) d.month) 12 ) ("returns its day" (let d (date 1999 12 31) d.day) 31 ) ("returns its week-day" (let d (date 1999 12 31) d.week-day) 5 ) ("recognises not monday" (let d (date 2015 11 1) d.monday? ) nil ) ("recognises monday" (let d (date 2015 11 2) d.monday? ) t ) ("recognises tuesday" (let d (date 2015 11 3) d.tuesday? ) t ) ("recognises wednesday" (let d (date 2015 11 4) d.wednesday?) t ) ("recognises thursday" (let d (date 2015 11 5) d.thursday? ) t ) ("recognises friday" (let d (date 2015 11 6) d.friday? ) t ) ("recognises not friday" (let d (date 2015 11 7) d.friday? ) nil ) ("recognises saturday" (let d (date 2015 11 7) d.saturday? ) t ) ("recognises sunday" (let d (date 2015 11 8) d.sunday? ) t ) ("adds days" (let d (date 2015 11 8) (to-string (+ d 1))) "2015-11-09") ("adds more days" (let d (date 2015 11 8) (to-string (+ d 10))) "2015-11-18") ("subtracts a day" (let d (date 2015 11 18) (to-string (- d 1))) "2015-11-17") ("subtracts more days" (let d (date 2015 11 18) (to-string (- d 5))) "2015-11-13"))