Skip to content

Commit

Permalink
* tick.interval.bounds function is now consistent for years, year-mon…
Browse files Browse the repository at this point in the history
…ths and dates in setting the `end` to be inclusive

* Strings are no longer accepted as beginning/end when constructing an interval
* Strings are no longer accepted as arguments to clock
  • Loading branch information
henryw374 committed Aug 24, 2023
1 parent 6a0992f commit b1a2775
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 180 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
@@ -1,3 +1,9 @@
# 0.7.0

* tick.interval.bounds function is now consistent for years, year-months and dates in setting the `end` to be inclusive
* Strings are no longer accepted as beginning/end when constructing an interval
* Strings are no longer accepted as arguments to clock

# 0.6.1

Add equivalents of clojure.core's max-key and min-key
Expand Down
8 changes: 4 additions & 4 deletions docs/intervals.adoc
Expand Up @@ -4,7 +4,7 @@ In _tick_, an interval is a span of time defined by two points in time, the firs

Intervals are maps containing both a `tick/beginning` and a `tick/end` entry. This flexible design allows any Clojure map to be treated as an interval.

Intervals can be represented two local times as well as instants.
The start and end of an interval should have the same type.

Interval functions are currently alpha status and so reside in the `tick.alpha.interval` namespace, rather than the
main `tick.core` namespace.
Expand All @@ -24,8 +24,8 @@ Here we use a literal map syntax to construct an interval representing the last
[source.code,clojure]
----
{:tick/beginning "2018-12-31T23:55:00Z"
:tick/end "2019-01-01T00:00:00Z"}
{:tick/beginning (t/instant "2018-12-31T23:55:00Z")
:tick/end (t/instant "2019-01-01T00:00:00Z"})
----
====
Expand All @@ -43,7 +43,7 @@ Alternatively, we can use the `t.i/new-interval` function which takes the two bo

== Derivation

Dates, months and years can also be considered to be themselves ranges, and can be converted to intervals with the `t.i/bounds` function.
Dates, months and years can also be considered to be themselves ranges, and can be converted to intervals with the `t.i/bounds` function. The start and end are both inclusive. This means for example that the `end` of one day `meets` the start of the next day.

====
To return today as an interval:
Expand Down

0 comments on commit b1a2775

Please sign in to comment.