mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 08:20:45 -05:00
✨ Allow floats on db/interval constructor
This commit is contained in:
parent
ef2918a115
commit
d3347a1be0
1 changed files with 10 additions and 10 deletions
|
@ -367,23 +367,23 @@
|
|||
(.rollback conn sp)))
|
||||
|
||||
(defn interval
|
||||
[data]
|
||||
[o]
|
||||
(cond
|
||||
(integer? data)
|
||||
(->> (/ data 1000.0)
|
||||
(or (integer? o)
|
||||
(float? o))
|
||||
(->> (/ o 1000.0)
|
||||
(format "%s seconds")
|
||||
(pginterval))
|
||||
|
||||
(string? data)
|
||||
(pginterval data)
|
||||
(string? o)
|
||||
(pginterval o)
|
||||
|
||||
(dt/duration? data)
|
||||
(->> (/ (.toMillis ^java.time.Duration data) 1000.0)
|
||||
(format "%s seconds")
|
||||
(pginterval))
|
||||
(dt/duration? o)
|
||||
(interval (inst-ms o))
|
||||
|
||||
:else
|
||||
(ex/raise :type :not-implemented)))
|
||||
(ex/raise :type :not-implemented
|
||||
:hint (format "no implementation found for value %s" (pr-str o)))))
|
||||
|
||||
(defn decode-json-pgobject
|
||||
[^PGobject o]
|
||||
|
|
Loading…
Reference in a new issue