-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
💡 [FEAT] make the dateparser return date in the furture as default #136
Comments
Hey @arvyanh, Instead I'm using dateutil which has less features but is very fast and does not affect load times. If you know a workaround or any other library feel free to share :) |
Just had a brief look at the dateutil, which the Maybe try (it's pip installed vs pacman installed, so I can't say if there's issue with this simple testing)
[ins] In [52]: cal = parsedatetime.Calendar()
[ins] In [53]: cal.parse("1d")
Out[53]:
(time.struct_time(tm_year=2023, tm_mon=8, tm_mday=2, tm_hour=3, tm_min=26, tm_sec=11, tm_wday=2, tm_yday=214, tm_isdst=-1),
1)
[ins] In [54]: cal.parse("8-1")
Out[54]:
(time.struct_time(tm_year=2023, tm_mon=8, tm_mday=1, tm_hour=3, tm_min=26, tm_sec=16, tm_wday=1, tm_yday=213, tm_isdst=0),
1) |
This is pretty good except it'd implicitly also set the time too! is_time_included = any(i in value.lower() for i in [":", "@", "at", "am", "pm"]) something like this. How'd you mention time explicitly? |
Is your feature request related to a problem? 😢 Please describe.
when enter "1d" in the date, the the updated date is 1 day back in time
Describe the solution you'd like 🤔
I think in 99% cases when we are editing a todo's date, we are trying to write a date in future (instead of a date back in time)
so I suggest in
utils/dateparser
file, change the line to:The effect:
The text was updated successfully, but these errors were encountered: