|
55 | 55 | from pandas._libs import (lib, index as libindex, tslib as libts,
|
56 | 56 | join as libjoin, Timestamp)
|
57 | 57 | from pandas._libs.tslibs import (timezones, conversion, fields, parsing,
|
| 58 | + ccalendar, |
58 | 59 | resolution as libresolution)
|
59 | 60 |
|
60 | 61 | # -------- some conversion wrapper functions
|
@@ -1451,14 +1452,14 @@ def _parsed_string_to_bounds(self, reso, parsed):
|
1451 | 1452 | Timestamp(datetime(parsed.year, 12, 31, 23,
|
1452 | 1453 | 59, 59, 999999), tz=self.tz))
|
1453 | 1454 | elif reso == 'month':
|
1454 |
| - d = libts.monthrange(parsed.year, parsed.month)[1] |
| 1455 | + d = ccalendar.get_days_in_month(parsed.year, parsed.month) |
1455 | 1456 | return (Timestamp(datetime(parsed.year, parsed.month, 1),
|
1456 | 1457 | tz=self.tz),
|
1457 | 1458 | Timestamp(datetime(parsed.year, parsed.month, d, 23,
|
1458 | 1459 | 59, 59, 999999), tz=self.tz))
|
1459 | 1460 | elif reso == 'quarter':
|
1460 | 1461 | qe = (((parsed.month - 1) + 2) % 12) + 1 # two months ahead
|
1461 |
| - d = libts.monthrange(parsed.year, qe)[1] # at end of month |
| 1462 | + d = ccalendar.get_days_in_month(parsed.year, qe) # at end of month |
1462 | 1463 | return (Timestamp(datetime(parsed.year, parsed.month, 1),
|
1463 | 1464 | tz=self.tz),
|
1464 | 1465 | Timestamp(datetime(parsed.year, qe, d, 23, 59,
|
|
0 commit comments