Skip to content

Commit

Permalink
Fix reflection warning in with-time-at-start-of-day (#219)
Browse files Browse the repository at this point in the history
* Fix reflection warning in with-time-at-start-of-day

* Minor trailing whitespace fixes
  • Loading branch information
joelittlejohn authored and seancorfield committed Oct 19, 2016
1 parent 31e3f7c commit ac5fb15
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/clj_time/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@
(defn ^DateTime with-time-at-start-of-day
"Returns a DateTime representing the start of the day. Normally midnight,
but not always true, as in some time zones with daylight savings."
[dt]
[^DateTime dt]
(.withTimeAtStartOfDay dt))

(defn epoch
Expand Down Expand Up @@ -481,7 +481,7 @@
(Seconds/seconds n)))

(extend-protocol InTimeUnitProtocol
org.joda.time.Interval
org.joda.time.Interval
(in-millis [this] (.toDurationMillis this))
(in-seconds [this] (.getSeconds (.toPeriod this (seconds))))
(in-minutes [this] (.getMinutes (.toPeriod this (minutes))))
Expand All @@ -497,7 +497,7 @@
(in-hours [this] (-> this .toPeriod .toStandardHours .getHours))
(in-days [this] (-> this .toPeriod .toStandardDays .getDays))
(in-weeks [this] (-> this .toPeriod .toStandardWeeks .getWeeks))
(in-months [this]
(in-months [this]
(condp instance? this
org.joda.time.Months (.getMonths ^org.joda.time.Months this)
org.joda.time.Years (* 12 (.getYears ^org.joda.time.Years this))
Expand All @@ -518,14 +518,14 @@
[^Interval in]
(deprecated "in-msecs has been deprecated in favor of in-millis")
(in-millis in))

(defn in-secs
"DEPRECATED: Returns the number of standard seconds in the given Interval."
{:deprecated "0.6.0"}
[^Interval in]
(deprecated "in-secs has been deprecated in favor of in-seconds")
(in-seconds in))

(defn secs
"DEPRECATED"
{:deprecated "0.6.0"}
Expand Down

0 comments on commit ac5fb15

Please sign in to comment.