File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 163163 (single-after? [d# o#]
164164 (.isAfter d# o#))
165165 (single-before? [d# o#]
166- (.isBefore d# o#))))))
166+ (.isBefore d# o#))
167+ jt.c/As
168+ (as* [o# k#]
169+ (jt.c/value (jt.c/property o# k#)))))))
167170
168171(enumerated-entity DayOfWeek
169172 " Returns the `DayOfWeek` for the given day keyword name (e.g. `:monday`),
Original file line number Diff line number Diff line change 644644 (is (= 1 (j/as (j/local-date 2015 1 1 ) :day-of-month )))
645645 (is (= 2015 (j/as (j/local-date 2015 1 1 ) :year ))))
646646
647+ (testing " temporal-accessor"
648+ (let [month-day-under-test (j/month-day 3 31 )]
649+ (is (= 3 (j/as month-day-under-test :month-of-year )))
650+ (is (= 31 (j/as month-day-under-test :day-of-month )))
651+ (is (thrown? Exception (j/as month-day-under-test :year ))))
652+ (let [year-month-under-test (j/year-month 2018 3 )]
653+ (is (= 2018 (j/as year-month-under-test :year )))
654+ (is (= 3 (j/as year-month-under-test :month-of-year )))
655+ (is (thrown? Exception (j/as year-month-under-test :day-of-month )))))
656+
647657 (testing " multiple"
648658 (is (= [2015 1 1 ] (j/as (j/local-date 2015 1 1 ) :year :month-of-year :day-of-month ))))
649659
You can’t perform that action at this time.
0 commit comments