LoginSignup
6
7

More than 5 years have passed since last update.

株が取引できる日か判定する、trading_day_jpというgemをこしらえた

Posted at

日本の証券取引所が開いている日かどうか判定するgemを作りました。祝日の判定にはholiday_jpを使っています。
「市場が開いている場合には○○する」といった用途に使える便利gemです。

date = Date.new(2014, 12, 30)

date.trading_day_jp? # => true
TradingDayJp.open?(date) # => true

date = Date.new(2014, 12, 31)

date.trading_day_jp? # => false
TradingDayJp.open?(date) # => false
6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7