Five weekends: Difference between revisions

→‎{{header|J}}: format inside verb
(→‎{{header|J}}: format inside verb)
Line 13:
months=. 1 3 5 7 8 10 12
dates=. 31
fivewkds=. (#~ 0 = weekday) >,{years;months;dates NB. 5 full weekends iff 31st is Sunday(0)
>'MMM YYYY' fmtDate toDayNo fivewkds
)</lang>
'''Usage:'''
<lang j> # find5wkdMonths '' NB. number of months found
201
>'MMM YYYY' fmtDate toDayNo (5&{. , '...' , _5&{.) find5wkdMonths '' NB. First and last 5 months found
Mar 1901
Aug 1902
Line 24 ⟶ 25:
Jan 1904
Jul 1904
...
Mar 2097
Aug 2098
892

edits