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 0da44c4 commit ec9dd44
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 190 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/index.html
Expand Up @@ -2459,7 +2459,7 @@ <h2 id="_intervals">7. Intervals</h2>
<p>Intervals are maps containing both a <code>tick/beginning</code> and a <code>tick/end</code> entry. This flexible design allows any Clojure map to be treated as an interval.</p>
</div>
<div class="paragraph">
<p>Intervals can be represented two local times as well as instants.</p>
<p>The start and end of an interval should have the same type.</p>
</div>
<div class="paragraph">
<p>Interval functions are currently alpha status and so reside in the <code>tick.alpha.interval</code> namespace, rather than the
Expand All @@ -2485,8 +2485,8 @@ <h3 id="_construction_4">7.1. Construction</h3>
</div>
<div class="listingblock code">
<div class="content">
<pre class="highlight"><code class="language-clojure" data-lang="clojure">{:tick/beginning "2018-12-31T23:55:00Z"
:tick/end "2019-01-01T00:00:00Z"}</code></pre>
<pre class="highlight"><code class="language-clojure" data-lang="clojure">{:tick/beginning (t/instant "2018-12-31T23:55:00Z")
:tick/end (t/instant "2019-01-01T00:00:00Z"})</code></pre>
</div>
</div>
</div>
Expand All @@ -2509,7 +2509,7 @@ <h3 id="_construction_4">7.1. Construction</h3>
<div class="sect2">
<h3 id="_derivation_3">7.2. Derivation</h3>
<div class="paragraph">
<p>Dates, months and years can also be considered to be themselves ranges, and can be converted to intervals with the <code>t.i/bounds</code> function.</p>
<p>Dates, months and years can also be considered to be themselves ranges, and can be converted to intervals with the <code>t.i/bounds</code> function. The start and end are both inclusive. This means for example that the <code>end</code> of one day <code>meets</code> the start of the next day.</p>
</div>
<div class="exampleblock">
<div class="content">
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 ec9dd44

Please sign in to comment.