Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpreting backwards instead of forwards #240

Open
jrw35 opened this issue Dec 8, 2019 · 1 comment
Open

Interpreting backwards instead of forwards #240

jrw35 opened this issue Dec 8, 2019 · 1 comment
Labels

Comments

@jrw35
Copy link

jrw35 commented Dec 8, 2019

Hi. At the moment I think parsedatetime always interprets a string like "Friday" as meaning "next Friday". Is it possible to choose to make the default be the opposite? So "Friday" on its own would mean "last Friday".

Thanks very much. This is an incredibly useful project.

@bear
Copy link
Owner

bear commented May 31, 2020

@jrw35 apologies for the slow response...

You can control that by passing to the Calendar() object when creating it a custom Constant() object that has the DOWParseStyle set

See the source https://github.com/bear/parsedatetime/blob/master/parsedatetime/__init__.py#L2352 for what the value to set it is

@bear bear added the question label May 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants