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

support dates like "next tuesday" #1100

Open
anarcat opened this issue Mar 24, 2022 · 2 comments
Open

support dates like "next tuesday" #1100

anarcat opened this issue Mar 24, 2022 · 2 comments

Comments

@anarcat
Copy link

anarcat commented Mar 24, 2022

Feature Request

It would be great if arrow supported more human-readable date specifications like "next tuesday" or "previous year"... This is something only parsedatetime does right now, as far as I know.

anarcat@curie:undertime(main)$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
>>> arrow.__version__
'1.2.1'
>>> arrow.utcnow().dehumanize("next tuesday")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/arrow/arrow.py", line 1421, in dehumanize
    raise ValueError(
ValueError: Input string not valid. Note: Some locales do not support the week granulairty in Arrow. If you are attempting to use the week granularity on an unsupported locale, this could be the cause of this error.
>>> 
@anishnya
Copy link
Member

This definitely is something we want to add going forward. #1081 would help making sure this has broad support beyond just English.

@krisfremen
Copy link
Member

Indeed, cldr has most of the relative types for many languages.

This would mean a bit of a refactor and changes to the current locale setup to accommodate the layout of cldr as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants