Skip to content

fix reported difference in datetime when passed in a date in the future (addresses #44)#45

Merged
hlship merged 6 commits intoclj-commons:masterfrom
jf:fix_datetime_calc_for_dates
May 4, 2026
Merged

fix reported difference in datetime when passed in a date in the future (addresses #44)#45
hlship merged 6 commits intoclj-commons:masterfrom
jf:fix_datetime_calc_for_dates

Conversation

@jf
Copy link
Copy Markdown
Contributor

@jf jf commented Nov 15, 2024

Addresses #44

I considered a couple of approaches, ranging from adding the current time (and then with a +1 second; good grief! just in order to be able to bump it up at the nanosecond-level to just past 24 hours) to then-dt using atTime, to maybe doing something with the cond if passed in a date; but ultimately settled on this one as the most elegant.

A couple of notes:

  • I must apologize for not adding in tests for this just yet; I can take a look at this in time to come (but would also be fine getting help for this) DONE
  • I decided to make (datetime (java.time.LocalDate/now)) equal "today" (rather than "a moment ago"); I think that makes sense

we do this by simply "coercing" the :now-dt argument to be ~at midnight
as well~ when then-dt is a java.time.LocalDate
@jf jf requested a review from hlship as a code owner November 15, 2024 23:06
@hlship hlship added this to the 1.2 milestone Mar 13, 2025
@hlship hlship modified the milestones: 1.2, 1.3 Mar 23, 2026
@hlship
Copy link
Copy Markdown
Collaborator

hlship commented Mar 24, 2026

This looks like a good idea, but need to figure out how to make the ClojureScript tests pass. I haven't look into it yet.

@jf
Copy link
Copy Markdown
Contributor Author

jf commented May 3, 2026

This looks like a good idea, but need to figure out how to make the ClojureScript tests pass. I haven't look into it yet.

The tests should be fixed now. Please have a look!

@hlship hlship merged commit 0e327b5 into clj-commons:master May 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants