require 'dates'

NB.*weekdaynth v returns the date triple of the nth weekday of the month
NB. x=(year,month) -- defults to current year an month
NB. y=weekday,number
weekdaynth=:3 : 0
(2 {. 6!:0 '') weekdaynth y
:
'w n'=.2 {.!.1 y
f=.weekday x,1
x, 1+(7*_1+n)+7|w-f
)

AndrewNikitin/weekdaynth (last edited 2011-06-13 16:27:16 by AndrewNikitin)