Skip to content

Commit f17ef80

Browse files
Update daily.py
1 parent b1b54d6 commit f17ef80

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas_datareader/iex/daily.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,16 @@ def _range_string_from_date(self):
101101
elif 1 <= years < 2:
102102
return "2y"
103103
elif 0 <= years < 1:
104+
estimated_days = ((365 * delta.years) + (30 * delta.months) + (delta.days)) * -1
105+
if 0 <= estimated_days < 6:
106+
return "5d"
107+
elif 6 <= estimated_days < 28:
108+
return "1m"
109+
elif 28 <= estimated_days < 84:
110+
return "3m"
111+
elif 84 <= estimated_days < 168:
112+
return "6m"
113+
104114
return "1y"
105115
else:
106116
raise ValueError(

0 commit comments

Comments
 (0)