Skip to content

How can I compare two dates with specified precision? #137

Open
@khmelevskii

Description

@khmelevskii

Hello.

I need to compare two dates without hours, minutes, seconds.
I can do something like this:

(and
  (= (t/year date1) (t/year date2))
  (= (t/month date1) (t/month date2))
  (= (t/day date1) (t/day date2)))

but it looks verbose.
it would be great to have function something like this:

(same? date1 date2 :day)
(same? date1 date2 :hour)
(same? date1 date2 :month)
etc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions