给定日期范围 2020-01-15 到 2021-05-10,我们需要将其拆分为每年季度的日期范围。
Ex:
First partial quarter 2020-01-15 to 2020-03-31
After That Allow complete Quarters from 2020-04-01 to 2021-03-31 ...
The last Partial Quarter as 2021-04-01 to 2021-05-10
该函数应该返回一个元组列表的元组,其中一个可以是部分季度的列表,第二个可以是完整季度的列表。
返回值如下:
(
[('2020-01-15', '2020-03-31'), ('2021-04-01', '2021-05-10')],
[('2020-04-01', '2020-06-30'), ('2020-07-01', '2020-09-30'), ('2020-10-01', '2020-12-31'), ('2021-01-01', '2021-03-31')]
)
如果范围是完整的 Quaters,则说 (2020-04-01, 2021-03-31) 返回值如下:
(
[],
[('2020-04-01', '2020-06-30'), ('2020-07-01', '2020-09-30'), ('2020-10-01', '2020-12-31'), ('2021-01-01', '2021-03-31')]
)
万一部分 Quater 说 (2020-04-01, 2021-05-10) 返回值如下:
(
[('2021-04-01', '2021-05-10')],
[('2020-04-01', '2020-06-30'), ('2020-07-01', '2020-09-30'), ('2020-10-01', '2020-12-31'), ('2021-01-01', '2021-03-31')]
)