2012年4月2日月曜日

rails で指定日の月末日を取得する

ActiveSupportがインストールされていれば、「end_of_month」で取得できる

date = Date.today                        ←こちらはruby(require 'date' が必要)
  end_date = date.end_of_month


(参考)
http://d.hatena.ne.jp/spitfire_tree/20080223/1203760297