dateparser icon indicating copy to clipboard operation
dateparser copied to clipboard

Add support for time ranges

Open aparatext opened this issue 4 years ago • 1 comments

Why?

A lot of use cases for date parsing may include the need to understand date ranges. Natural language search by date may need to parse input as a time span. Like interpreting "yesterday" as 2021.6.21 00:01 to 2021.6.21 23:60, instead of 2021.6.21 18:40.

Examples

  • Next week
  • Yesterday
  • This year
  • Next winter
  • This evening
  • Yesterday evening to Tomorrow morning
  • Monday to Friday

Implementation

Maybe it can be a parser setting. It can be implemented something like this: parse('yesterday', settings={'DATE_RANGE': True}).

aparatext avatar Jun 22 '21 15:06 aparatext

Related to https://github.com/scrapinghub/dateparser/issues/262

Gallaecio avatar Jul 13 '21 14:07 Gallaecio