Calculate how many days in month by index in Ruby

Member

lou_lindgren

by lou_lindgren , in category: Ruby , 2 months ago

Calculate how many days in month by index in Ruby

1
2
3
def days(index)
  ((15662003>>(2*(index-1)))&3) + 28
end


Facebook Twitter LinkedIn Telegram Whatsapp Pocket

no answers