title: python last working day of month (with CustomBusinessDay)?
body: <p>I like to calculate last working day before or after a specific date(includes holidays, not just weekends)?</p>
  
  <pre><code>import datetime as dt
  
  from pandas.tseries.holiday import AbstractHolidayCalendar, Holiday, nearest_workday, \
      USMartinLutherKingJr, USPresidentsDay, GoodFriday, USMemorialDay, \
      USLaborDay, USThanksgivingDay
  
  
  class USTradingCalendar(AbstractHolidayCalendar):
      rules = [
          Holiday('NewYearsDay', month=1, day=1, observance=nearest_workday),
          USMartinLutherKingJr,
          USPresidentsDay,
          GoodFriday,
          USMemorialDay,
          Holiday('USIndependenceDay', month=7, day=4, observance=nearest_workday),
          USLaborDay,
          USThanksgivingDay,
          Holiday('Christmas', month=12, day=25, observance=nearest_workday)
      ]
  
  
  def get_trading_close_holidays(fromyear, toyear):
      inst = USTradingCalendar()
  
      return inst.holidays(dt.datetime(fromyear-1, 12, 31), dt.datetime(toyear, 12, 31))
  
  print(get_trading_close_holidays(2018,2018))
  
  &gt;&gt; DatetimeIndex(['2018-01-01', '2018-01-15', '2018-02-19', '2018-03-30', '2018-05-28', '2018-07-04', '2018-09-03', '2018-11-22', '2018-12-25'], dtype='datetime64[ns]', freq=None)
  
  import datetime as dt
  from pandas.tseries.holiday import USFederalHolidayCalendar
  bday_us = CustomBusinessDay(calendar=get_trading_close_holidays(2000,2050))
  d = dt.datetime(2018, 3, 31)
  d - bday_us
  
  &gt;&gt; Timestamp('2018-03-30 00:00:00')
  </code></pre>
  
  <p>This falls on Good Friday, that holiday(as shown)... should show 1 day before = 2018-03-29...</p>
  
  <p>What's the issue?</p>