-
Notifications
You must be signed in to change notification settings - Fork 31
fix relative date time handling #152
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
fix relative date time handling #152
Conversation
37c0acb
to
6ebdf73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, as you noted in your TODO, this is not too pretty ,-)
I wonder, can you do multiple passes over the vector? And remember whether date/time was set? (and recover the missing pieces from at
as needed)
It doesn't seem like order matters for the Relative times, e.g.
date "+1 hour 2023-03-03"
date "2023-03-03 +1 hour"
both output
Fri Mar 3 01:00:00 AM CET 2023
I'm not too sure about this codebase, but maybe something like this:
Date
,DateTime
,Time
,Year
?- Then recover date/time from
at
as required? - Then
Weekday
? - Then Relative?
You could use Vec's filter to make sure that we actually go through all items.
(btw, can you cherry-pick just 6ebdf73 for this PR? I don't think this needs to stack on top of the other PR -- but IMHO that other PR could go in first...)
6ebdf73
to
ca7fa0d
Compare
Okay I've cherry picked only this one commit in the PR. As for the date time assembling, I've have some ideas how to improve. Will follow up on it. |
Cool thanks.
Do you mean follow-up as a separate PR or here? I'll let maintainers decide, but since we'd need a new release of |
I will do it in a separate PR. |
it has a conflict, sorry |
ca7fa0d
to
f4367e4
Compare
Addressed, thanks. |
f4367e4
to
de9de05
Compare
0629d8c
to
e5af24e
Compare
Rebased on top of #155 . |
e5af24e
to
9b67307
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #152 +/- ##
===========================
===========================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Closes #151.