Skip to content

Commit d43fa6b

Browse files
committed
Close #91: add java-time.api, soft deprecate java-time ns
1 parent a9aac4b commit d43fa6b

File tree

15 files changed

+2017
-1290
lines changed

15 files changed

+2017
-1290
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## NEXT
4+
5+
Due to [#91](https://github.com/dm3/clojure.java-time/issues/91), the main `java-time`
6+
namespace has been deprecated. A new namespace `java-time.api` has been created
7+
8+
Note that this change is entirely optional---`java-time` and `java-time.api` will continue to be in sync and may coexist.
9+
10+
See [the docstring for `java-time`](https://dm3.github.io/clojure.java-time/java-time.html) for more details.
11+
312
## 1.0.0
413

514
Released 2022-11-24.

README.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
A Clojure wrapper for Java 8 Date-Time API.
66

7+
> Note: This library has no relation Clojure's (or Java's) core team.
8+
> It's naming is legacy and preserved for backwards compatibility reasons.
9+
710
## Rationale
811

912
Main goals:
@@ -38,7 +41,7 @@ is purely on the merits of a broader feature set.
3841

3942
## Documentation
4043

41-
* [API](http://dm3.github.io/clojure.java-time/)
44+
* [API](https://dm3.github.io/clojure.java-time/)
4245
* [![cljdoc badge](https://cljdoc.org/badge/clojure.java-time/clojure.java-time)](https://cljdoc.org/d/clojure.java-time/clojure.java-time/CURRENT)
4346

4447
## What's different in Java Time API?
@@ -50,9 +53,9 @@ complicated than it has to be. Also, a few concepts have faulty designs which
5053
lead to hard to fix bugs and misuse. You can see the birds-eye view of changes
5154
and some of the rationale on the author's (Stephen Colebourne) blog:
5255

53-
* [what's wrong with Joda-Time](http://blog.joda.org/2009/11/why-jsr-310-isn-joda-time_4941.html),
54-
* [when you should use Java-Time](http://blog.joda.org/2014/07/threeten-backport-vs-joda-time.html)
55-
* [what's different in Java-Time](http://blog.joda.org/2014/11/converting-from-joda-time-to-javatime.html).
56+
* [what's wrong with Joda-Time](https://blog.joda.org/2009/11/why-jsr-310-isn-joda-time_4941.html),
57+
* [when you should use Java-Time](https://blog.joda.org/2014/07/threeten-backport-vs-joda-time.html)
58+
* [what's different in Java-Time](https://blog.joda.org/2014/11/converting-from-joda-time-to-javatime.html).
5659

5760
You can also take a look at a [comprehensive comparison](http://time4j.net/tutorial/appendix.html) by the
5861
[Time4J](http://time4j.net/) authors.
@@ -61,28 +64,28 @@ You can also take a look at a [comprehensive comparison](http://time4j.net/tutor
6164

6265
Add the following dependency to your `deps.edn`
6366
```clj
64-
clojure.java-time/clojure.java-time {:mvn/version "0.3.3"}
67+
clojure.java-time/clojure.java-time {:mvn/version "1.0.0"}
6568
```
6669

6770
or to your `project.clj` or `build.boot`:
6871

6972
```clj
70-
[clojure.java-time "0.3.3"]
73+
[clojure.java-time "1.0.0"]
7174
```
7275

7376
The [API](https://dm3.github.io/clojure.java-time/) of the Clojure.Java-Time
74-
consists of one namespace, namely `java-time`. For the purposes of this guide,
77+
consists of one namespace, namely `java-time.api`. For the purposes of this guide,
7578
we will `require` the main namespace:
7679

7780
```clj
78-
(require '[java-time :as jt]
81+
(require '[java-time.api :as jt]
7982
;; for REPL experimentation
8083
'java-time.repl)
8184
```
8285

8386
### Concept run-through
8487

85-
Java Time API may seem daunting. Instead of a single `java.util.Date` you have
88+
The Java Time API may seem daunting. Instead of a single `java.util.Date` you have
8689
a `ZonedDateTime`, `OffsetDateTime`, `LocalDateTime`, `Instant`, and other
8790
types. You would be well served by reading the official documentation for the
8891
[Java Time API](https://docs.oracle.com/javase/tutorial/datetime/iso/index.html),
@@ -96,11 +99,11 @@ are used to represent human-based dates/times. They are a good fit for represent
9699
the time of various events:
97100

98101
* `LocalDate` - birthday, holiday
99-
* see [`jt/local-date`](http://dm3.github.io/clojure.java-time/java-time.html#var-local-date)
102+
* see [`jt/local-date`](https://dm3.github.io/clojure.java-time/java-time.api.html#var-local-date)
100103
* `LocalTime` - bus schedule, opening time of a shop
101-
* see [`jt/local-time`](http://dm3.github.io/clojure.java-time/java-time.html#var-local-time)
104+
* see [`jt/local-time`](https://dm3.github.io/clojure.java-time/java-time.api.html#var-local-time)
102105
* `LocalDateTime` - start of a competition
103-
* see [`jt/local-date-time`](http://dm3.github.io/clojure.java-time/java-time.html#var-local-date-time)
106+
* see [`jt/local-date-time`](https://dm3.github.io/clojure.java-time/java-time.api.html#var-local-date-time)
104107

105108
Example usage:
106109

@@ -119,9 +122,9 @@ Example usage:
119122

120123
There are two types which deal with zones:
121124
* `OffsetDateTime`
122-
* see [`jt/offset-date-time`](https://dm3.github.io/clojure.java-time/java-time.html#var-offset-date-time)
125+
* see [`jt/offset-date-time`](https://dm3.github.io/clojure.java-time/java-time.api.html#var-offset-date-time)
123126
* `ZonedDateTime`
124-
* see [`jt/zoned-date-time`](https://dm3.github.io/clojure.java-time/java-time.html#var-zoned-date-time)
127+
* see [`jt/zoned-date-time`](https://dm3.github.io/clojure.java-time/java-time.api.html#var-zoned-date-time)
125128

126129
They do pretty much what you would expect from their name.
127130
You can think of the `Offset` time as a more concrete version of the `Zoned`
@@ -141,8 +144,8 @@ year due to DST or governmental regulations.
141144

142145
Offset/Zone times only take the offset/zone as the last arguments for the
143146
maximum arity constructor. You can influence the zone/offset by using the
144-
[`jt/with-zone`](https://dm3.github.io/clojure.java-time/java-time.html#var-with-zone)
145-
or [`jt/with-offset`](https://dm3.github.io/clojure.java-time/java-time.html#var-with-offset) functions, like so:
147+
[`jt/with-zone`](https://dm3.github.io/clojure.java-time/java-time.api.html#var-with-zone)
148+
or [`jt/with-offset`](https://dm3.github.io/clojure.java-time/java-time.api.html#var-with-offset) functions, like so:
146149

147150
```clj
148151
(jt/with-zone (jt/zoned-date-time 2015 10) "UTC")

docs/CHANGELOG.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<!DOCTYPE html PUBLIC ""
22
"">
3-
<html><head><meta charset="UTF-8" /><title>Changelog</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Clojure.java-time</span> <span class="project-version">1.0.0</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="README.html"><div class="inner"><span>Clojure.Java-Time</span></div></a></li><li class="depth-1 current"><a href="CHANGELOG.html"><div class="inner"><span>Changelog</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><a href="java-time.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>java-time</span></div></a></li><li class="depth-2"><a href="java-time.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#changelog" id="changelog"></a>Changelog</h1>
3+
<html><head><meta charset="UTF-8" /><title>Changelog</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Clojure.java-time</span> <span class="project-version">1.1.0-SNAPSHOT</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="README.html"><div class="inner"><span>Clojure.Java-Time</span></div></a></li><li class="depth-1 current"><a href="CHANGELOG.html"><div class="inner"><span>Changelog</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><a href="java-time.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>java-time</span></div></a></li><li class="depth-2 branch"><a href="java-time.api.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>api</span></div></a></li><li class="depth-2"><a href="java-time.repl.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>repl</span></div></a></li></ul></div><div class="document" id="content"><div class="doc"><div class="markdown"><h1><a href="#changelog" id="changelog"></a>Changelog</h1>
4+
<h2><a href="#next" id="next"></a>NEXT</h2>
5+
<p>Due to <a href="https://github.com/dm3/clojure.java-time/issues/91">#91</a>, the main <code>java-time</code> namespace has been deprecated. A new namespace <code>java-time.api</code> has been created</p>
6+
<p>Note that this change is entirely optional—<code>java-time</code> and <code>java-time.api</code> will continue to be in sync and may coexist.</p>
7+
<p>See <a href="https://dm3.github.io/clojure.java-time/java-time.html">the docstring for <code>java-time</code></a> for more details.</p>
48
<h2><a href="#100" id="100"></a>1.0.0</h2>
59
<p>Released 2022-11-24.</p>
610
<h3><a href="#new-features" id="new-features"></a>New Features</h3>

0 commit comments

Comments
 (0)