Skip to content

Commit f784bdd

Browse files
committed
format: add with-default-year implementation
1 parent 506d16b commit f784bdd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/clj_time/format.clj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
[^DateTimeFormatter f ^DateTimeZone dtz]
8080
(.withZone f dtz))
8181

82+
(defn with-default-year
83+
"Return a copy of a formatter that uses the given default year."
84+
[^DateTimeFormatter f ^Integer default-year]
85+
(.withDefaultYear f default-year))
86+
8287
(def ^{:doc "Map of ISO 8601 and a single RFC 822 formatters that can be used for parsing and, in most
8388
cases, printing."}
8489
formatters

0 commit comments

Comments
 (0)