Public Vars

Back

of-months (clj)

(source)

function

(of-months n)
Takes a java.lang.Long n and returns a period of n months.

Examples

tick
(ns tick.api-test
  (:require
    [clojure.test
     :refer [deftest is testing run-tests]
     :refer-macros [deftest is testing run-tests]]
    [tick.core :as t]
    [tick.locale-en-us]
    [tick.protocols :as p]
    [cljc.java-time.clock]
    [cljc.java-time.instant]
    [cljc.java-time.day-of-week]
    [cljc.java-time.month]
    [cljc.java-time.year]
    #?@(:cljs [[java.time :refer [Instant]]]))
  #?(:clj
     (:import [java.time Instant])))


;; Periods. Convenience functions to create periods of specific
;; units.
(deftest period-functions-test
  (is (= (t/of-days 10) (t/new-period 10 :days)))
  (is (= (t/of-months 10) (t/new-period 10 :months)))
  (is (= (t/of-years 10) (t/new-period 10 :years))))