when icon indicating copy to clipboard operation
when copied to clipboard

bias ExactMonthDate towards future dates

Open crockeo opened this issue 3 years ago • 1 comments

Hi! I picked up when in a quick project to file tasks into notion, and it's been great so far! I'm glad I don't have to rewrite all of this natural time parsing myself. Being the end of the year, I've been trying to schedule tasks for next January when I go back to work, and was surprised when they were parsed as January of 2021 instead of 2022.

I was wondering:

  • Is it intentional that ExactMonthDate parses, e.g. January 4th as 2021-01-04 instead of 2022-01-04?
  • If not, would it be possible to bias ExactMonthDate the next occurrence of the date? This is a breaking change to the library, so I understand if it's not acceptable to upstream.

I do have a working approach (that isn't particularly well thought out :grin:) which I could turn over to a pull request if y'all are interested.

Thanks!

crockeo avatar Dec 27 '21 19:12 crockeo

Hi @crockeo,

that's great to see you found it useful for your project!

Yeah, the issue you describe is not easy to solve in general because it requires more knowledge about the context of using the library. As you mentioned it does not default behaviour so we would probably want to leave defaults as they are but nothing blocks us to implement it as an option, for example, you can create a rule that picks up the next occurrence of the date.

Thank would be really nice to have it a rule-level option! Happy to review a PR!

olebedev avatar Jan 05 '22 00:01 olebedev