>>235
個人的には、>>122の汎用的なロジックが好きだから
y,m を引数するとして

m==12?getDayID( y+1,1,1):getDayID( y,m+1,1) - getDayID( y,m,1 )
を提示