BUG: Don't include out-of-range date in early closes

Don't include New Year's Eve 1999 in the early closes returned to the
user if it's outside the range of dates requested by the user.
This commit is contained in:
Jonathan Kamens
2013-07-24 12:40:28 -04:00
parent 6fc077a573
commit a1a1fbf21f
+3 -1
View File
@@ -346,6 +346,8 @@ def get_early_closes(start, end):
# http://www.nyse.com/pdfs/closings.pdf
#
# New Year's Eve
early_closes.append(datetime(1999, 12, 31, tzinfo=pytz.utc))
nye_1999 = datetime(1999, 12, 31, tzinfo=pytz.utc)
if start <= nye_1999 and nye_1999 <= end:
early_closes.append(nye_1999)
return pd.DatetimeIndex(sorted(early_closes))