├── dev.cljs.edn ├── src └── jiffy │ ├── dev │ ├── main.cljs │ └── wip.cljs │ ├── date_time_exception.cljs │ ├── zone │ ├── zone_rules_exception.cljs │ ├── tzdb_zone_rules_provider.cljs │ ├── zone_rules_provider.cljs │ ├── zone_offset_transition_rule.cljs │ ├── zone_offset_transition.cljs │ └── zone_rules.cljs │ ├── time_comparable.cljs │ ├── temporal │ ├── temporal_query.cljs │ ├── temporal_adjuster.cljs │ ├── unsupported_temporal_type_exception.cljs │ ├── temporal_amount.cljs │ ├── julian_fields.cljs │ ├── temporal_unit.cljs │ ├── temporal_field.cljs │ ├── temporal.cljs │ ├── temporal_accessor.cljs │ ├── iso_fields.cljs │ ├── chrono_unit.cljs │ ├── temporal_queries.cljs │ ├── temporal_adjusters.cljs │ ├── chrono_field.cljs │ ├── week_fields.cljs │ └── value_range.cljs │ ├── math.cljs │ ├── big_decimal.cljs │ ├── chrono │ ├── era.cljs │ ├── chrono_period.cljs │ ├── chrono_local_date_time.cljs │ ├── chrono_local_date.cljs │ ├── chrono_period_impl.cljs │ ├── chrono_zoned_date_time.cljs │ ├── chronology.cljs │ ├── chrono_zoned_date_time_impl.cljs │ ├── japanese_era.cljs │ ├── chrono_local_date_impl.cljs │ ├── abstract_chronology.cljs │ ├── minguo_chronology.cljs │ ├── thai_buddhist_chronology.cljs │ ├── chrono_local_date_time_impl.cljs │ ├── japanese_chronology.cljs │ ├── iso_chronology.cljs │ ├── minguo_date.cljs │ ├── thai_buddhist_date.cljs │ └── japanese_date.cljs │ ├── system_clock.cljs │ ├── zone_region.cljs │ ├── format │ ├── date_time_parse_exception.cljs │ ├── parsed.cljs │ ├── date_time_print_context.cljs │ ├── date_time_text_provider.cljs │ ├── decimal_style.cljs │ └── date_time_parse_context.cljs │ ├── zone_id.cljs │ ├── clock.cljs │ ├── zone_offset.cljs │ ├── month_day.cljs │ ├── period.cljs │ └── year.cljs ├── deps.edn └── README.md /dev.cljs.edn: -------------------------------------------------------------------------------- 1 | {:main jiffy.dev.main} 2 | -------------------------------------------------------------------------------- /src/jiffy/dev/main.cljs: -------------------------------------------------------------------------------- 1 | (ns java-time-clj.main) 2 | 3 | (enable-console-print!) 4 | -------------------------------------------------------------------------------- /src/jiffy/dev/wip.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.dev.wip) 2 | 3 | (defn wip [where] 4 | (throw (ex-info (str "not implemented: " where) {}))) 5 | -------------------------------------------------------------------------------- /src/jiffy/date_time_exception.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.date-time-exception) 2 | 3 | (defn DateTimeException 4 | ([s] (DateTimeException s nil nil)) 5 | ([s m] (DateTimeException s m nil)) 6 | ([s m e] (ex-info s (or m {})))) 7 | -------------------------------------------------------------------------------- /src/jiffy/zone/zone_rules_exception.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.zone.zone-rules-exception) 2 | 3 | ;; FIXME: no implementation found from inherited class class java.time.DateTimeException 4 | (defn ZoneRulesException 5 | ([s] (ZoneRulesException s nil nil)) 6 | ([s m] (ZoneRulesException s m nil)) 7 | ([s m e] (ex-info s (or m {})))) 8 | -------------------------------------------------------------------------------- /src/jiffy/time_comparable.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.time-comparable 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/lang/Comparable.java 5 | (defprotocol ITimeComparable 6 | (compareTo [this o])) 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/jiffy/temporal/temporal_query.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.temporal-query 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQuery.java 5 | (defprotocol ITemporalQuery 6 | (queryFrom [this temporal])) 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/jiffy/temporal/temporal_adjuster.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.temporal-adjuster 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjuster.java 5 | (defprotocol ITemporalAdjuster 6 | (adjustInto [this temporal])) 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/jiffy/temporal/unsupported_temporal_type_exception.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.unsupported-temporal-type-exception) 2 | 3 | ;; FIXME: no implementation found from inherited class class java.time.DateTimeException 4 | (defn UnsupportedTemporalTypeException 5 | ([s] (UnsupportedTemporalTypeException s nil nil)) 6 | ([s m] (UnsupportedTemporalTypeException s m nil)) 7 | ([s m e] (ex-info s (or m {})))) 8 | -------------------------------------------------------------------------------- /deps.edn: -------------------------------------------------------------------------------- 1 | {:paths ["src" "target" "resources""dev-resources"] 2 | :deps {org.clojure/clojure {:mvn/version "1.10.0-alpha8"} 3 | com.bhauman/figwheel-main {:mvn/version "0.1.9"} 4 | com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}} 5 | :aliases {:nrepl {:extra-deps {nrepl/nrepl {:mvn/version "0.4.5"}} 6 | :extra-paths ["test"]} 7 | :dev {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]} 8 | :test {:extra-paths ["test"]}}} 9 | -------------------------------------------------------------------------------- /src/jiffy/temporal/temporal_amount.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.temporal-amount 2 | (:refer-clojure :exclude [get ]) 3 | (:require [jiffy.dev.wip :refer [wip]])) 4 | 5 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAmount.java 6 | (defprotocol ITemporalAmount 7 | (get [this unit]) 8 | (getUnits [this]) 9 | (addTo [this temporal]) 10 | (subtractFrom [this temporal])) 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/jiffy/math.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.math) 2 | 3 | ;; TODO: find proper value for min and max 4 | (def long-max-value 999999999999999999999999999) 5 | (def long-min-value -999999999999999999999999999) 6 | 7 | ;; TODO: check correctness 8 | 9 | (defn add-exact [& args] 10 | (apply + args)) 11 | 12 | (defn floor-div [x y] 13 | (long (/ x y))) 14 | 15 | (defn floor-mod [x y] 16 | (mod x y)) 17 | 18 | (defn multiply-exact [x y] 19 | (* x y)) 20 | 21 | (defn subtract-exact [x y] 22 | (- x y)) 23 | -------------------------------------------------------------------------------- /src/jiffy/big_decimal.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.big-decimal 2 | (:refer-clojure :exclude [divide]) 3 | (:require [jiffy.dev.wip :refer [wip]])) 4 | 5 | (defn add [x y] (wip ::add--not-implemented)) 6 | 7 | (defn value-of [unscaled-val & [scale]] (wip ::value-of--not-implemented)) 8 | 9 | (defn multiply [this big-decimal] (wip ::multiply--not-implemented)) 10 | 11 | (defn divide [this other rounding-mode] (wip ::divide--not-implemented)) 12 | 13 | (defn divide-to-integral-value [this divisor] (wip ::divide-to-integral-value--not-implemented)) 14 | 15 | (defn long-value-exact [this] (wip ::long-value-exact--not-implemented)) 16 | -------------------------------------------------------------------------------- /src/jiffy/chrono/era.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.era 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 4 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 5 | 6 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Era.java 7 | (defprotocol IEra 8 | (getValue [this]) 9 | (getDisplayName [this style locale])) 10 | 11 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Era.java#L320 12 | (defn -get-display-name [this style locale] (wip ::-get-display-name)) 13 | 14 | -------------------------------------------------------------------------------- /src/jiffy/temporal/julian_fields.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.julian-fields 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | 5 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/JulianFields.java#L147 6 | (def JULIAN_DAY ::JULIAN_DAY--not-implemented) 7 | 8 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/JulianFields.java#L188 9 | (def MODIFIED_JULIAN_DAY ::MODIFIED_JULIAN_DAY--not-implemented) 10 | 11 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/JulianFields.java#L208 12 | (def RATA_DIE ::RATA_DIE--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/temporal/temporal_unit.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.temporal-unit 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalUnit.java 5 | (defprotocol ITemporalUnit 6 | (getDuration [this]) 7 | (isDurationEstimated [this]) 8 | (isDateBased [this]) 9 | (isTimeBased [this]) 10 | (isSupportedBy [this temporal]) 11 | (addTo [this temporal amount]) 12 | (between [this temporal1inclusive temporal2exclusive])) 13 | 14 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalUnit.java#L168 15 | (defn -is-supported-by [this temporal] (wip ::-is-supported-by)) 16 | 17 | -------------------------------------------------------------------------------- /src/jiffy/system_clock.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.system-clock 2 | (:require [jiffy.clock :as Clock] 3 | [jiffy.instant :as Instant] 4 | [jiffy.zone-offset :as ZoneOffset])) 5 | 6 | (defrecord SystemClock [zone]) 7 | 8 | (def -get-zone :zone) 9 | 10 | (defn -with-zone [this zone] 11 | (if (= (:zone this) zone) 12 | this 13 | (->SystemClock zone))) 14 | 15 | (defn -millis [this] 16 | (.getTime (js/Date.))) 17 | 18 | (defn -instant [this] 19 | (Instant/ofEpochMilli (-millis this))) 20 | 21 | (extend-type SystemClock 22 | Clock/IClock 23 | (getZone [this] (-get-zone this)) 24 | (withZone [this zone] (-with-zone this zone)) 25 | (millis [this] (-millis this)) 26 | (instant [this] (-instant this))) 27 | 28 | ;; TODO: use ZoneOffset/UTC 29 | (defmethod Clock/-system-utc :system-utc [_] 30 | (->SystemClock nil 31 | ;; (ZoneOffset/UTC) 32 | )) 33 | -------------------------------------------------------------------------------- /src/jiffy/zone_region.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.zone-region 2 | (:require [jiffy.dev.wip :refer [wip]] [jiffy.zone-id :as ZoneId])) 3 | 4 | (defrecord ZoneRegion []) 5 | 6 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneRegion.java#L169 7 | (defn -get-id [this] (wip ::-get-id)) 8 | 9 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneRegion.java#L174 10 | (defn -get-rules [this] (wip ::-get-rules)) 11 | 12 | (extend-type ZoneRegion 13 | ZoneId/IZoneId 14 | (getId [this] (-get-id this)) 15 | (getRules [this] (-get-rules this))) 16 | 17 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneRegion.java#L114 18 | (defn ofId [zone-id check-available] (wip ::ofId)) 19 | -------------------------------------------------------------------------------- /src/jiffy/temporal/temporal_field.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.temporal-field 2 | (:refer-clojure :exclude [range resolve]) 3 | (:require [jiffy.dev.wip :refer [wip]])) 4 | 5 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalField.java 6 | (defprotocol ITemporalField 7 | (getDisplayName [this locale]) 8 | (getBaseUnit [this]) 9 | (getRangeUnit [this]) 10 | (range [this]) 11 | (isDateBased [this]) 12 | (isTimeBased [this]) 13 | (isSupportedBy [this temporal]) 14 | (rangeRefinedBy [this temporal]) 15 | (getFrom [this temporal]) 16 | (adjustInto [this temporal new-value]) 17 | (resolve [this field-values partial-temporal resolver-style])) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalField.java#L107 20 | (defn -get-display-name [this locale] (wip ::-get-display-name)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalField.java#L374 23 | (defn -resolve [this field-values partial-temporal resolver-style] (wip ::-resolve)) 24 | 25 | -------------------------------------------------------------------------------- /src/jiffy/zone/tzdb_zone_rules_provider.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.zone.tzdb-zone-rules-provider 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.zone.zone-rules-provider :as ZoneRulesProvider])) 4 | 5 | (defrecord TzdbZoneRulesProvider []) 6 | 7 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/TzdbZoneRulesProvider.java#L121 8 | (defn -provide-zone-ids [this] (wip ::-provide-zone-ids)) 9 | 10 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/TzdbZoneRulesProvider.java#L126 11 | (defn -provide-rules [this zone-id for-caching] (wip ::-provide-rules)) 12 | 13 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/TzdbZoneRulesProvider.java#L146 14 | (defn -provide-versions [this zone-id] (wip ::-provide-versions)) 15 | 16 | (extend-type TzdbZoneRulesProvider 17 | ZoneRulesProvider/IZoneRulesProvider 18 | (provideZoneIds [this] (-provide-zone-ids this)) 19 | (provideRules [this zone-id for-caching] (-provide-rules this zone-id for-caching)) 20 | (provideVersions [this zone-id] (-provide-versions this zone-id))) 21 | 22 | -------------------------------------------------------------------------------- /src/jiffy/format/date_time_parse_exception.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.format.date-time-parse-exception 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.date-time-exception :as DateTimeException])) 4 | 5 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseException.java 6 | (defprotocol IDateTimeParseException 7 | (getParsedString [this]) 8 | (getErrorIndex [this])) 9 | 10 | (defrecord DateTimeParseException []) 11 | 12 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseException.java#L125 13 | (defn -get-parsed-string [this] (wip ::-get-parsed-string)) 14 | 15 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseException.java#L134 16 | (defn -get-error-index [this] (wip ::-get-error-index)) 17 | 18 | (extend-type DateTimeParseException 19 | IDateTimeParseException 20 | (getParsedString [this] (-get-parsed-string this)) 21 | (getErrorIndex [this] (-get-error-index this))) 22 | 23 | ;; FIXME: no implementation found from inherited class class java.time.DateTimeException 24 | 25 | -------------------------------------------------------------------------------- /src/jiffy/temporal/temporal.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.temporal 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.temporal.temporal-accessor :as TemporalAccessor])) 4 | 5 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/Temporal.java 6 | (defprotocol ITemporal 7 | (with [this adjuster] [this field new-value]) 8 | (plus [this amount] [this amount-to-add unit]) 9 | (minus [this amount] [this amount-to-subtract unit]) 10 | (until [this end-exclusive unit])) 11 | 12 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/Temporal.java#L189 13 | (defn -with [this adjuster] (wip ::-with)) 14 | 15 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/Temporal.java#L261 16 | (defn -plus [this amount] (wip ::-plus)) 17 | 18 | (defn -minus 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/Temporal.java#L333 20 | ([this amount] (wip ::-minus)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/Temporal.java#L369 23 | ([this amount-to-subtract unit] (wip ::-minus))) 24 | 25 | -------------------------------------------------------------------------------- /src/jiffy/chrono/chrono_period.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.chrono-period 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.temporal.temporal-amount :as TemporalAmount])) 4 | 5 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriod.java 6 | (defprotocol IChronoPeriod 7 | (getChronology [this]) 8 | (isZero [this]) 9 | (isNegative [this]) 10 | (plus [this amount-to-add]) 11 | (minus [this amount-to-subtract]) 12 | (multipliedBy [this scalar]) 13 | (negated [this]) 14 | (normalized [this])) 15 | 16 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriod.java#L172 17 | (defn -is-zero [this] (wip ::-is-zero)) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriod.java#L186 20 | (defn -is-negative [this] (wip ::-is-negative)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriod.java#L255 23 | (defn -negated [this] (wip ::-negated)) 24 | 25 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriod.java#L116 26 | (defn between [start-date-inclusive end-date-exclusive] (wip ::between)) 27 | -------------------------------------------------------------------------------- /src/jiffy/temporal/temporal_accessor.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.temporal-accessor 2 | (:refer-clojure :exclude [get range]) 3 | (:require [jiffy.dev.wip :refer [wip]] 4 | [jiffy.temporal.temporal-field :as TemporalField])) 5 | 6 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAccessor.java 7 | (defprotocol ITemporalAccessor 8 | (isSupported [this field]) 9 | (range [this field]) 10 | (get [this field]) 11 | (getLong [this field]) 12 | (query [this query])) 13 | 14 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAccessor.java#L169 15 | (defn -range [this field] (wip ::-range)) 16 | (defn -range [this field] 17 | (if (instance? field IChronoField/ChronoField) 18 | (if (isSupported this field) 19 | (range this field) 20 | (throw (UnsupportedTemporalTypeException (str "Unsupported field: " field)))) 21 | (TemporalField/rangeRefinedBy field this))) 22 | 23 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAccessor.java#L217 24 | (defn -get [this field] (wip ::-get)) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAccessor.java#L308 27 | (defn -query [this query] (wip ::-query)) 28 | 29 | -------------------------------------------------------------------------------- /src/jiffy/temporal/iso_fields.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.iso-fields 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/IsoFields.java#L740 5 | (defn isIso [temporal] (wip ::isIso)) 6 | 7 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/IsoFields.java#L200 8 | (def DAY_OF_QUARTER ::DAY_OF_QUARTER--not-implemented) 9 | 10 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/IsoFields.java#L215 11 | (def QUARTER_OF_YEAR ::QUARTER_OF_YEAR--not-implemented) 12 | 13 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/IsoFields.java#L245 14 | (def WEEK_OF_WEEK_BASED_YEAR ::WEEK_OF_WEEK_BASED_YEAR--not-implemented) 15 | 16 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/IsoFields.java#L259 17 | (def WEEK_BASED_YEAR ::WEEK_BASED_YEAR--not-implemented) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/IsoFields.java#L274 20 | (def WEEK_BASED_YEARS ::WEEK_BASED_YEARS--not-implemented) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/IsoFields.java#L282 23 | (def QUARTER_YEARS ::QUARTER_YEARS--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/format/parsed.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.format.parsed 2 | (:refer-clojure :exclude [resolve ]) 3 | (:require [jiffy.dev.wip :refer [wip]] 4 | [jiffy.temporal.temporal-accessor :as TemporalAccessor])) 5 | 6 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/Parsed.java 7 | (defprotocol IParsed 8 | (copy [this]) 9 | (resolve [this resolver-style resolver-fields])) 10 | 11 | (defrecord Parsed []) 12 | 13 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/Parsed.java#L168 14 | (defn -copy [this] (wip ::-copy)) 15 | 16 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/Parsed.java#L248 17 | (defn -resolve [this resolver-style resolver-fields] (wip ::-resolve)) 18 | 19 | (extend-type Parsed 20 | IParsed 21 | (copy [this] (-copy this)) 22 | (resolve [this resolver-style resolver-fields] (-resolve this resolver-style resolver-fields))) 23 | 24 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/Parsed.java#L180 25 | (defn -is-supported [this field] (wip ::-is-supported)) 26 | 27 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/Parsed.java#L190 28 | (defn -get-long [this field] (wip ::-get-long)) 29 | 30 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/Parsed.java#L210 31 | (defn -query [this query] (wip ::-query)) 32 | 33 | (extend-type Parsed 34 | TemporalAccessor/ITemporalAccessor 35 | (isSupported [this field] (-is-supported this field)) 36 | (getLong [this field] (-get-long this field)) 37 | (query [this query] (-query this query))) 38 | 39 | -------------------------------------------------------------------------------- /src/jiffy/temporal/chrono_unit.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.chrono-unit 2 | (:require ;; [jiffy.duration :as Duration] 3 | [jiffy.math :as math])) 4 | 5 | (defprotocol IChronoUnit) 6 | 7 | (defrecord ChronoUnit [name estimated-duration]) 8 | 9 | ;; TODO: untangle circular dependency between chrono-unit and duration 10 | 11 | ;; strategy: 12 | ;; Create duration via multimethod defined alongside duration ns. Need to make 13 | ;; sure the evaluation of chrono-unit namespace happens after multimethod 14 | ;; implementation in jiffy.duration has been registered 15 | 16 | (def NANOS (->ChronoUnit "Nanos" nil ;; (Duration/ofNanos 1) 17 | )) 18 | (def MICROS (->ChronoUnit "Micros" nil ;; (Duration/ofNanos 1000) 19 | )) 20 | (def MILLIS (->ChronoUnit "Millis" nil ;; (Duration/ofNanos 1000000) 21 | )) 22 | (def SECONDS (->ChronoUnit "Seconds" nil ;; (Duration/ofSeconds 1) 23 | )) 24 | (def MINUTES (->ChronoUnit "Minutes" nil ;; (Duration/ofSeconds 60) 25 | )) 26 | (def HOURS (->ChronoUnit "Hours" nil ;; (Duration/ofSeconds 3600) 27 | )) 28 | (def HALF_DAYS (->ChronoUnit "HalfDays" nil ;; (Duration/ofSeconds 43200) 29 | )) 30 | (def DAYS (->ChronoUnit "Days" nil ;; (Duration/ofSeconds 86400) 31 | )) 32 | (def WEEKS (->ChronoUnit "Weeks" nil ;; (Duration/ofSeconds (* 7 86400)) 33 | )) 34 | (def MONTHS (->ChronoUnit "Months" nil ;; (Duration/ofSeconds (/ 31556952 12)) 35 | )) 36 | (def YEARS (->ChronoUnit "Years" nil ;; (Duration/ofSeconds 31556952) 37 | )) 38 | (def DECADES (->ChronoUnit "Decades" nil ;; (Duration/ofSeconds (* 31556952 10)) 39 | )) 40 | (def CENTURIES (->ChronoUnit "Centuries" nil ;; (Duration/ofSeconds (* 31556952 100)) 41 | )) 42 | (def MILLENNIA (->ChronoUnit "Millennia" nil ;; (Duration/ofSeconds (* 31556952 1000)) 43 | )) 44 | (def ERAS (->ChronoUnit "Eras" nil ;; (Duration/ofSeconds (* 31556952 1000000000)) 45 | )) 46 | (def FOREVER (->ChronoUnit "Forever" nil ;; (Duration/ofSeconds math/long-max-value 999999999) 47 | )) 48 | -------------------------------------------------------------------------------- /src/jiffy/format/date_time_print_context.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.format.date-time-print-context 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimePrintContext.java 5 | (defprotocol IDateTimePrintContext 6 | (getTemporal [this]) 7 | (getLocale [this]) 8 | (getDecimalStyle [this]) 9 | (startOptional [this]) 10 | (endOptional [this]) 11 | (getValue [this get-value--overloaded-param])) 12 | 13 | (defrecord DateTimePrintContext []) 14 | 15 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimePrintContext.java#L237 16 | (defn -get-temporal [this] (wip ::-get-temporal)) 17 | 18 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimePrintContext.java#L249 19 | (defn -get-locale [this] (wip ::-get-locale)) 20 | 21 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimePrintContext.java#L260 22 | (defn -get-decimal-style [this] (wip ::-get-decimal-style)) 23 | 24 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimePrintContext.java#L268 25 | (defn -start-optional [this] (wip ::-start-optional)) 26 | 27 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimePrintContext.java#L275 28 | (defn -end-optional [this] (wip ::-end-optional)) 29 | 30 | ;; NB! This method is overloaded! 31 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimePrintContext.java#L286 32 | (defn -get-value [this get-value--overloaded-param] (wip ::-get-value)) 33 | 34 | (extend-type DateTimePrintContext 35 | IDateTimePrintContext 36 | (getTemporal [this] (-get-temporal this)) 37 | (getLocale [this] (-get-locale this)) 38 | (getDecimalStyle [this] (-get-decimal-style this)) 39 | (startOptional [this] (-start-optional this)) 40 | (endOptional [this] (-end-optional this)) 41 | (getValue [this get-value--overloaded-param] (-get-value this get-value--overloaded-param))) 42 | 43 | -------------------------------------------------------------------------------- /src/jiffy/format/date_time_text_provider.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.format.date-time-text-provider 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java 5 | (defprotocol IDateTimeTextProvider 6 | (getText [this field value style locale] [this chrono field value style locale]) 7 | (getTextIterator [this field style locale] [this chrono field style locale])) 8 | 9 | (defrecord DateTimeTextProvider []) 10 | 11 | (defn -get-text 12 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java#L143 13 | ([this field value style locale] (wip ::-get-text)) 14 | 15 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java#L166 16 | ([this chrono field value style locale] (wip ::-get-text))) 17 | 18 | (defn -get-text-iterator 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java#L221 20 | ([this field style locale] (wip ::-get-text-iterator)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java#L246 23 | ([this chrono field style locale] (wip ::-get-text-iterator))) 24 | 25 | (extend-type DateTimeTextProvider 26 | IDateTimeTextProvider 27 | (getText 28 | ([this field value style locale] (-get-text this field value style locale)) 29 | ([this chrono field value style locale] (-get-text this chrono field value style locale))) 30 | (getTextIterator 31 | ([this field style locale] (-get-text-iterator this field style locale)) 32 | ([this chrono field style locale] (-get-text-iterator this chrono field style locale)))) 33 | 34 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java#L125 35 | (defn getInstance [] (wip ::getInstance)) 36 | 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeTextProvider.java#L511 38 | (defn getLocalizedResource [key locale] (wip ::getLocalizedResource)) 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jiffy 2 | 3 | Jiffy is a port of Java Time to Clojurescript. As far as possible it aims at being at parity with Java API. 4 | 5 | Jiffy is currently work in progress! 6 | 7 | ## I need your help 8 | 9 | Porting the Java Time API to Clojurescript is not done in a jiffy (pun intended). Luckily, Java Time ships as an 10 | immutable API, making the job tolerable. Porting the API to Clojurescript should be an exercise in mechanically 11 | rewriting Java to Clojurescript, _without even the need for you to understand the logic behind the code_. 12 | 13 | The skeletal structure of the complete API has already been generated from the OpenJDK source code. All the corresponding 14 | constructs for Java Time's classes, interface, static methods and fields are already in place and stubbed out. 15 | 16 | * For every class file in the Java Time, Jiffy has a corresponding namespace. E.g. `jiffy.instant` corresponds to `java.time.Instant`. 17 | * For every interface in Java Time, Jiffy has a corresponding protocol. The name of the protocol is named after the corresponding 18 | Java interface with one tiny exception; Jiffy's protocols are prefixed with the letter 'I', e.g. `ITemporal` (see Differences for rationale) 19 | * For every public static methods and fields in Java Time, Jiffy has a corresponding function. 20 | * For every (concrete) class in Java Time, Jiffy has it's corresponding record. 21 | * For every public method in Java Time, Jiffy has it's corresponding function. 22 | 23 | What's left is replacing the function bodies with actual working, beautiful Clojurescript code. 24 | 25 | ### Stop the rambling. I wanna contribute already! 26 | 27 | 0. Install [Clojure CLI](https://clojure.org/guides/getting_started) and launch a Clojurescript REPL via `clj -m figwheel.main -b dev -r` 28 | 1. Pick any function in this repository missing an implementation (preferrably in the `jiffy` and `jiffy.temporal` namespaces) 29 | 2. Navigate to the corresponding Java implementation by following the link above the function decleration. 30 | 3. Type corresponding Clojurescript that compiles! 31 | 4. Repeat steps 1 - 4. 32 | 33 | Have a look at the `jiffy.instant` namespace. It contains a complete port of the `java.time.Instant`. 34 | 35 | ### I'm not able to run my code without some other parts of the code throwing an exception 36 | 37 | Yeah, that's rather unfortunate, but your contribution makes is one step closer to have actual running code. 38 | 39 | ### What about testing? 40 | 41 | Testing will be accomplished in two parts; 42 | 43 | * Porting of Java Time's unit tests 44 | * Generative tests checking parity between Jiffy and Java Time 45 | 46 | Feel free to start porting tests, but my main concern at the moment is mechnically porting the Java Time implementation; we won't 47 | be able to exercise any base API until the vital parts are in place. 48 | -------------------------------------------------------------------------------- /src/jiffy/zone/zone_rules_provider.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.zone.zone-rules-provider 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java 5 | (defprotocol IZoneRulesProvider 6 | (provideZoneIds [this]) 7 | (provideRules [this zone-id for-caching]) 8 | (provideVersions [this zone-id]) 9 | (provideRefresh [this])) 10 | 11 | (defrecord ZoneRulesProvider []) 12 | 13 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java#L376 14 | (defn -provide-zone-ids [this] (wip ::-provide-zone-ids)) 15 | 16 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java#L404 17 | (defn -provide-rules [this zone-id for-caching] (wip ::-provide-rules)) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java#L429 20 | (defn -provide-versions [this zone-id] (wip ::-provide-versions)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java#L444 23 | (defn -provide-refresh [this] (wip ::-provide-refresh)) 24 | 25 | (extend-type ZoneRulesProvider 26 | IZoneRulesProvider 27 | (provideZoneIds [this] (-provide-zone-ids this)) 28 | (provideRules [this zone-id for-caching] (-provide-rules this zone-id for-caching)) 29 | (provideVersions [this zone-id] (-provide-versions this zone-id)) 30 | (provideRefresh [this] (-provide-refresh this))) 31 | 32 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java#L205 33 | (defn getAvailableZoneIds [] (wip ::getAvailableZoneIds)) 34 | 35 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java#L232 36 | (defn getRules [zone-id for-caching] (wip ::getRules)) 37 | 38 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java#L261 39 | (defn getVersions [zone-id] (wip ::getVersions)) 40 | 41 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java#L300 42 | (defn registerProvider [provider] (wip ::registerProvider)) 43 | 44 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRulesProvider.java#L349 45 | (defn refresh [] (wip ::refresh)) 46 | -------------------------------------------------------------------------------- /src/jiffy/chrono/chrono_local_date_time.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.chrono-local-date-time 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.temporal.temporal :as Temporal] 5 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 6 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 7 | 8 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java 9 | (defprotocol IChronoLocalDateTime 10 | (getChronology [this]) 11 | (toLocalDate [this]) 12 | (toLocalTime [this]) 13 | (format [this formatter]) 14 | (atZone [this zone]) 15 | (toInstant [this offset]) 16 | (toEpochSecond [this offset]) 17 | (isAfter [this other]) 18 | (isBefore [this other]) 19 | (isEqual [this other])) 20 | 21 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java#L192 22 | (defn -get-chronology [this] (wip ::-get-chronology)) 23 | 24 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java#L404 25 | (defn -format [this formatter] (wip ::-format)) 26 | 27 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java#L452 28 | (defn -to-instant [this offset] (wip ::-to-instant)) 29 | 30 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java#L470 31 | (defn -to-epoch-second [this offset] (wip ::-to-epoch-second)) 32 | 33 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java#L531 34 | (defn -is-after [this other] (wip ::-is-after)) 35 | 36 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java#L552 37 | (defn -is-before [this other] (wip ::-is-before)) 38 | 39 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java#L573 40 | (defn -is-equal [this other] (wip ::-is-equal)) 41 | 42 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java#L139 43 | (defn timeLineOrder [] (wip ::timeLineOrder)) 44 | 45 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTime.java#L171 46 | (defn from [temporal] (wip ::from)) 47 | -------------------------------------------------------------------------------- /src/jiffy/zone_id.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.zone-id 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java 5 | (defprotocol IZoneId 6 | (normalized [this]) 7 | (getId [this]) 8 | (getDisplayName [this style locale]) 9 | (getRules [this])) 10 | 11 | (defrecord ZoneId []) 12 | 13 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L125 14 | (defn -normalized [this] (wip ::-normalized)) 15 | 16 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L487 17 | (defn -get-id [this] (wip ::-get-id)) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L504 20 | (defn -get-display-name [this style locale] (wip ::-get-display-name)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L562 23 | (defn -get-rules [this] (wip ::-get-rules)) 24 | 25 | (extend-type ZoneId 26 | IZoneId 27 | (normalized [this] (-normalized this)) 28 | (getId [this] (-get-id this)) 29 | (getDisplayName [this style locale] (-get-display-name this style locale)) 30 | (getRules [this] (-get-rules this))) 31 | 32 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L271 33 | (defn systemDefault [] (wip ::systemDefault)) 34 | 35 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L287 36 | (defn getAvailableZoneIds [] (wip ::getAvailableZoneIds)) 37 | 38 | (defn of 39 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L355 40 | ([zone-id] (wip ::of)) 41 | 42 | ;; NB! This method is overloaded! 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L308 44 | ([of--overloaded-param-1 of--overloaded-param-2] (wip ::of))) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L372 47 | (defn ofOffset [prefix offset] (wip ::ofOffset)) 48 | 49 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L459 50 | (defn from [temporal] (wip ::from)) 51 | 52 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneId.java#L224 53 | (def SHORT_IDS ::SHORT_IDS--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/temporal/temporal_queries.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.temporal-queries 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L167 5 | (defn zoneId [] (wip ::zoneId)) 6 | 7 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L206 8 | (defn chronology [] (wip ::chronology)) 9 | 10 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L243 11 | (defn precision [] (wip ::precision)) 12 | 13 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L267 14 | (defn zone [] (wip ::zone)) 15 | 16 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L290 17 | (defn offset [] (wip ::offset)) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L313 20 | (defn localDate [] (wip ::localDate)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L336 23 | (defn localTime [] (wip ::localTime)) 24 | 25 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L344 26 | (def ZONE_ID ::ZONE_ID--not-implemented) 27 | 28 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L359 29 | (def CHRONO ::CHRONO--not-implemented) 30 | 31 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L375 32 | (def PRECISION ::PRECISION--not-implemented) 33 | 34 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L391 35 | (def OFFSET ::OFFSET--not-implemented) 36 | 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L409 38 | (def ZONE ::ZONE--not-implemented) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L425 41 | (def LOCAL_DATE ::LOCAL_DATE--not-implemented) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalQueries.java#L443 44 | (def LOCAL_TIME ::LOCAL_TIME--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/clock.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.clock 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java 5 | (defprotocol IClock 6 | (getZone [this]) 7 | (withZone [this zone]) 8 | (millis [this]) 9 | (instant [this])) 10 | 11 | (defrecord Clock []) 12 | 13 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L399 14 | (defn -get-zone [this] (wip ::-get-zone)) 15 | 16 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L411 17 | (defn -with-zone [this zone] (wip ::-with-zone)) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L431 20 | (defn -millis [this] (wip ::-millis)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L444 23 | (defn -instant [this] (wip ::-instant)) 24 | 25 | (extend-type Clock 26 | IClock 27 | (getZone [this] (-get-zone this)) 28 | (withZone [this zone] (-with-zone this zone)) 29 | (millis [this] (-millis this)) 30 | (instant [this] (-instant this))) 31 | 32 | (defmulti -system-utc identity) 33 | 34 | (defn systemUTC [] 35 | (-system-utc :system-utc)) 36 | 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L183 38 | (defn systemDefaultZone [] (wip ::systemDefaultZone)) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L202 41 | (defn system [zone] (wip ::system)) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L231 44 | (defn tickMillis [zone] (wip ::tickMillis)) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L255 47 | (defn tickSeconds [zone] (wip ::tickSeconds)) 48 | 49 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L278 50 | (defn tickMinutes [zone] (wip ::tickMinutes)) 51 | 52 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L313 53 | (defn tick [base-clock tick-duration] (wip ::tick)) 54 | 55 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L348 56 | (defn fixed [fixed-instant zone] (wip ::fixed)) 57 | 58 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Clock.java#L374 59 | (defn offset [base-clock offset-duration] (wip ::offset)) 60 | -------------------------------------------------------------------------------- /src/jiffy/chrono/chrono_local_date.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.chrono-local-date 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.temporal.temporal :as Temporal] 5 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 6 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 7 | 8 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java 9 | (defprotocol IChronoLocalDate 10 | (getChronology [this]) 11 | (getEra [this]) 12 | (isLeapYear [this]) 13 | (lengthOfMonth [this]) 14 | (lengthOfYear [this]) 15 | (toEpochDay [this]) 16 | (until [this end-date-exclusive]) 17 | (format [this formatter]) 18 | (atTime [this local-time]) 19 | (isAfter [this other]) 20 | (isBefore [this other]) 21 | (isEqual [this other])) 22 | 23 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L325 24 | (defn -get-era [this] (wip ::-get-era)) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L340 27 | (defn -is-leap-year [this] (wip ::-is-leap-year)) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L362 30 | (defn -length-of-year [this] (wip ::-length-of-year)) 31 | 32 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L551 33 | (defn -to-epoch-day [this] (wip ::-to-epoch-day)) 34 | 35 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L640 36 | (defn -format [this formatter] (wip ::-format)) 37 | 38 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L656 39 | (defn -at-time [this local-time] (wip ::-at-time)) 40 | 41 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L728 42 | (defn -is-after [this other] (wip ::-is-after)) 43 | 44 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L746 45 | (defn -is-before [this other] (wip ::-is-before)) 46 | 47 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L764 48 | (defn -is-equal [this other] (wip ::-is-equal)) 49 | 50 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L259 51 | (defn timeLineOrder [] (wip ::timeLineOrder)) 52 | 53 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDate.java#L287 54 | (defn from [temporal] (wip ::from)) 55 | -------------------------------------------------------------------------------- /src/jiffy/temporal/temporal_adjusters.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.temporal-adjusters 2 | (:refer-clojure :exclude [next ]) 3 | (:require [jiffy.dev.wip :refer [wip]])) 4 | 5 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L139 6 | (defn ofDateAdjuster [date-based-adjuster] (wip ::ofDateAdjuster)) 7 | 8 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L165 9 | (defn firstDayOfMonth [] (wip ::firstDayOfMonth)) 10 | 11 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L188 12 | (defn lastDayOfMonth [] (wip ::lastDayOfMonth)) 13 | 14 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L208 15 | (defn firstDayOfNextMonth [] (wip ::firstDayOfNextMonth)) 16 | 17 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L229 18 | (defn firstDayOfYear [] (wip ::firstDayOfYear)) 19 | 20 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L250 21 | (defn lastDayOfYear [] (wip ::lastDayOfYear)) 22 | 23 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L269 24 | (defn firstDayOfNextYear [] (wip ::firstDayOfNextYear)) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L290 27 | (defn firstInMonth [day-of-week] (wip ::firstInMonth)) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L310 30 | (defn lastInMonth [day-of-week] (wip ::lastInMonth)) 31 | 32 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L346 33 | (defn dayOfWeekInMonth [ordinal day-of-week] (wip ::dayOfWeekInMonth)) 34 | 35 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L386 36 | (defn next [day-of-week] (wip ::next)) 37 | 38 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L412 39 | (defn nextOrSame [day-of-week] (wip ::nextOrSame)) 40 | 41 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L440 42 | (defn previous [day-of-week] (wip ::previous)) 43 | 44 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/TemporalAdjusters.java#L466 45 | (defn previousOrSame [day-of-week] (wip ::previousOrSame)) 46 | -------------------------------------------------------------------------------- /src/jiffy/chrono/chrono_period_impl.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.chrono-period-impl 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.chrono.chrono-period :as ChronoPeriod] 4 | [jiffy.temporal.temporal-amount :as TemporalAmount])) 5 | 6 | (defrecord ChronoPeriodImpl []) 7 | 8 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L156 9 | (defn -get-chronology [this] (wip ::-get-chronology)) 10 | 11 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L162 12 | (defn -is-zero [this] (wip ::-is-zero)) 13 | 14 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L167 15 | (defn -is-negative [this] (wip ::-is-negative)) 16 | 17 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L173 18 | (defn -plus [this amount-to-add] (wip ::-plus)) 19 | 20 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L183 21 | (defn -minus [this amount-to-subtract] (wip ::-minus)) 22 | 23 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L212 24 | (defn -multiplied-by [this scalar] (wip ::-multiplied-by)) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L225 27 | (defn -normalized [this] (wip ::-normalized)) 28 | 29 | (extend-type ChronoPeriodImpl 30 | ChronoPeriod/IChronoPeriod 31 | (getChronology [this] (-get-chronology this)) 32 | (isZero [this] (-is-zero this)) 33 | (isNegative [this] (-is-negative this)) 34 | (plus [this amount-to-add] (-plus this amount-to-add)) 35 | (minus [this amount-to-subtract] (-minus this amount-to-subtract)) 36 | (multipliedBy [this scalar] (-multiplied-by this scalar)) 37 | (normalized [this] (-normalized this))) 38 | 39 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L138 40 | (defn -get [this unit] (wip ::-get)) 41 | 42 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L151 43 | (defn -get-units [this] (wip ::-get-units)) 44 | 45 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L255 46 | (defn -add-to [this temporal] (wip ::-add-to)) 47 | 48 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoPeriodImpl.java#L281 49 | (defn -subtract-from [this temporal] (wip ::-subtract-from)) 50 | 51 | (extend-type ChronoPeriodImpl 52 | TemporalAmount/ITemporalAmount 53 | (get [this unit] (-get this unit)) 54 | (getUnits [this] (-get-units this)) 55 | (addTo [this temporal] (-add-to this temporal)) 56 | (subtractFrom [this temporal] (-subtract-from this temporal))) 57 | 58 | -------------------------------------------------------------------------------- /src/jiffy/chrono/chrono_zoned_date_time.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.chrono-zoned-date-time 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.temporal.temporal :as Temporal] 5 | [jiffy.temporal.temporal-accessor :as TemporalAccessor])) 6 | 7 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java 8 | (defprotocol IChronoZonedDateTime 9 | (toEpochSecond [this]) 10 | (toLocalDate [this]) 11 | (toLocalTime [this]) 12 | (toLocalDateTime [this]) 13 | (getChronology [this]) 14 | (getOffset [this]) 15 | (getZone [this]) 16 | (withEarlierOffsetAtOverlap [this]) 17 | (withLaterOffsetAtOverlap [this]) 18 | (withZoneSameLocal [this zone]) 19 | (withZoneSameInstant [this zone]) 20 | (format [this formatter]) 21 | (toInstant [this]) 22 | (isBefore [this other]) 23 | (isAfter [this other]) 24 | (isEqual [this other])) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L214 27 | (defn -to-epoch-second [this] (wip ::-to-epoch-second)) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L230 30 | (defn -to-local-date [this] (wip ::-to-local-date)) 31 | 32 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L242 33 | (defn -to-local-time [this] (wip ::-to-local-time)) 34 | 35 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L264 36 | (defn -get-chronology [this] (wip ::-get-chronology)) 37 | 38 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L521 39 | (defn -format [this formatter] (wip ::-format)) 40 | 41 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L537 42 | (defn -to-instant [this] (wip ::-to-instant)) 43 | 44 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L606 45 | (defn -is-before [this other] (wip ::-is-before)) 46 | 47 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L626 48 | (defn -is-after [this other] (wip ::-is-after)) 49 | 50 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L646 51 | (defn -is-equal [this other] (wip ::-is-equal)) 52 | 53 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L140 54 | (defn timeLineOrder [] (wip ::timeLineOrder)) 55 | 56 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTime.java#L172 57 | (defn from [temporal] (wip ::from)) 58 | -------------------------------------------------------------------------------- /src/jiffy/temporal/chrono_field.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.chrono-field 2 | (:require [jiffy.math :as math] 3 | [jiffy.temporal.chrono-unit :refer [DAYS HALF_DAYS HOURS MICROS MILLIS MINUTES NANOS SECONDS WEEKS FOREVER MONTHS YEARS ERAS]] 4 | [jiffy.temporal.value-range :as ValueRange] 5 | [jiffy.year :as Year])) 6 | 7 | (defprotocol IChronoField 8 | (checkValidValue [this value]) 9 | (checkValidIntValue [this value])) 10 | 11 | (defrecord ChronoField [name base-unit range-unit range display-name-key]) 12 | 13 | (defn create [name base-unit range-unit range & [display-name-key]] 14 | (->ChronoField name base-unit range-unit range display-name-key)) 15 | 16 | (def NANO_OF_SECOND (create "NanoOfSecond" NANOS SECONDS (ValueRange/of 0 999999999))) 17 | (def NANO_OF_DAY (create "NanoOfDay" NANOS DAYS (ValueRange/of 0 (-> 86400 (* 1000000000) (- 1))))) 18 | (def MICRO_OF_SECOND (create "MicroOfSecond" MICROS SECONDS (ValueRange/of 0 999999))) 19 | (def MICRO_OF_DAY (create "MicroOfDay" MICROS DAYS (ValueRange/of 0 (-> 86400 (* 1000000) (- 1))))) 20 | (def MILLI_OF_SECOND (create "MilliOfSecond" MILLIS SECONDS (ValueRange/of 0 999))) 21 | (def MILLI_OF_DAY (create "MilliOfDay" MILLIS DAYS (ValueRange/of 0 (-> 86400 (* 1000) (- 1))))) 22 | (def SECOND_OF_MINUTE (create "SecondOfMinute" SECONDS MINUTES (ValueRange/of 0 59) "second")) 23 | (def SECOND_OF_DAY (create "SecondOfDay" SECONDS DAYS (ValueRange/of 0 (- 86400 1)))) 24 | (def MINUTE_OF_HOUR (create "MinuteOfHour" MINUTES HOURS (ValueRange/of 0 59) "minute")) 25 | (def MINUTE_OF_DAY (create "MinuteOfDay" MINUTES DAYS (ValueRange/of 0 (-> 24 (* 60) (- 1))))) 26 | (def HOUR_OF_AMPM (create "HourOfAmPm" HOURS HALF_DAYS (ValueRange/of 0 11))) 27 | (def CLOCK_HOUR_OF_AMPM (create "ClockHourOfAmPm" HOURS HALF_DAYS (ValueRange/of 1 12))) 28 | (def HOUR_OF_DAY (create "HourOfDay" HOURS DAYS (ValueRange/of 0 23) "hour")) 29 | (def CLOCK_HOUR_OF_DAY (create "ClockHourOfDay" HOURS DAYS (ValueRange/of 1 24))) 30 | (def AMPM_OF_DAY (create "AmPmOfDay" HALF_DAYS DAYS (ValueRange/of 0 1) "dayperiod")) 31 | (def DAY_OF_WEEK (create "DayOfWeek" DAYS WEEKS (ValueRange/of 1 7) "weekday")) 32 | (def ALIGNED_DAY_OF_WEEK_IN_MONTH (create "AlignedDayOfWeekInMonth" DAYS WEEKS (ValueRange/of 1 7))) 33 | (def ALIGNED_DAY_OF_WEEK_IN_YEAR (create "AlignedDayOfWeekInYear" DAYS WEEKS (ValueRange/of 1 7))) 34 | (def DAY_OF_MONTH (create "DayOfMonth" DAYS MONTHS (ValueRange/of 1 28 31) "day")) 35 | (def DAY_OF_YEAR (create "DayOfYear" DAYS YEARS (ValueRange/of 1 365 366))) 36 | (def EPOCH_DAY (create "EpochDay" DAYS FOREVER (ValueRange/of (long (* Year/MIN_VALUE 365.25)) (long (* Year/MAX_VALUE 365.25))))) 37 | (def ALIGNED_WEEK_OF_MONTH (create "AlignedWeekOfMonth" WEEKS MONTHS (ValueRange/of 1 4 5))) 38 | (def ALIGNED_WEEK_OF_YEAR (create "AlignedWeekOfYear" WEEKS YEARS (ValueRange/of 1 53))) 39 | (def MONTH_OF_YEAR (create "MonthOfYear" MONTHS YEARS (ValueRange/of 1 12) "month")) 40 | (def PROLEPTIC_MONTH (create "ProlepticMonth" MONTHS FOREVER (ValueRange/of (* Year/MIN_VALUE 12) (-> Year/MAX_VALUE (* 12) (+ 11))))) 41 | (def YEAR_OF_ERA (create "YearOfEra" YEARS FOREVER (ValueRange/of 1 Year/MAX_VALUE (+ Year/MAX_VALUE 1)))) 42 | (def YEAR (create "Year" YEARS FOREVER (ValueRange/of Year/MIN_VALUE Year/MAX_VALUE) "year")) 43 | (def ERA (create "Era" ERAS FOREVER (ValueRange/of 0 1) "era")) 44 | (def INSTANT_SECONDS (create "InstantSeconds" SECONDS FOREVER (ValueRange/of math/long-min-value math/long-max-value))) 45 | (def OFFSET_SECONDS (create "OffsetSeconds" SECONDS FOREVER (ValueRange/of (* -18 3600) (* 18 3600)))) 46 | -------------------------------------------------------------------------------- /src/jiffy/temporal/week_fields.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.week-fields 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java 5 | (defprotocol IWeekFields 6 | (getFirstDayOfWeek [this]) 7 | (getMinimalDaysInFirstWeek [this]) 8 | (dayOfWeek [this]) 9 | (weekOfMonth [this]) 10 | (weekOfYear [this]) 11 | (weekOfWeekBasedYear [this]) 12 | (weekBasedYear [this])) 13 | 14 | (defrecord WeekFields []) 15 | 16 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L403 17 | (defn -get-first-day-of-week [this] (wip ::-get-first-day-of-week)) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L417 20 | (defn -get-minimal-days-in-first-week [this] (wip ::-get-minimal-days-in-first-week)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L440 23 | (defn -day-of-week [this] (wip ::-day-of-week)) 24 | 25 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L486 26 | (defn -week-of-month [this] (wip ::-week-of-month)) 27 | 28 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L531 29 | (defn -week-of-year [this] (wip ::-week-of-year)) 30 | 31 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L581 32 | (defn -week-of-week-based-year [this] (wip ::-week-of-week-based-year)) 33 | 34 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L623 35 | (defn -week-based-year [this] (wip ::-week-based-year)) 36 | 37 | (extend-type WeekFields 38 | IWeekFields 39 | (getFirstDayOfWeek [this] (-get-first-day-of-week this)) 40 | (getMinimalDaysInFirstWeek [this] (-get-minimal-days-in-first-week this)) 41 | (dayOfWeek [this] (-day-of-week this)) 42 | (weekOfMonth [this] (-week-of-month this)) 43 | (weekOfYear [this] (-week-of-year this)) 44 | (weekOfWeekBasedYear [this] (-week-of-week-based-year this)) 45 | (weekBasedYear [this] (-week-based-year this))) 46 | 47 | (defn of 48 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L298 49 | ([locale] (wip ::of)) 50 | 51 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L327 52 | ([first-day-of-week minimal-days-in-first-week] (wip ::of))) 53 | 54 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L213 55 | (def ISO ::ISO--not-implemented) 56 | 57 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L222 58 | (def SUNDAY_START ::SUNDAY_START--not-implemented) 59 | 60 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/WeekFields.java#L240 61 | (def WEEK_BASED_YEARS ::WEEK_BASED_YEARS--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/zone/zone_offset_transition_rule.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.zone.zone-offset-transition-rule 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java 5 | (defprotocol IZoneOffsetTransitionRule 6 | (getMonth [this]) 7 | (getDayOfMonthIndicator [this]) 8 | (getDayOfWeek [this]) 9 | (getLocalTime [this]) 10 | (isMidnightEndOfDay [this]) 11 | (getTimeDefinition [this]) 12 | (getStandardOffset [this]) 13 | (getOffsetBefore [this]) 14 | (getOffsetAfter [this]) 15 | (createTransition [this year])) 16 | 17 | (defrecord ZoneOffsetTransitionRule []) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L374 20 | (defn -get-month [this] (wip ::-get-month)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L396 23 | (defn -get-day-of-month-indicator [this] (wip ::-get-day-of-month-indicator)) 24 | 25 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L412 26 | (defn -get-day-of-week [this] (wip ::-get-day-of-week)) 27 | 28 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L424 29 | (defn -get-local-time [this] (wip ::-get-local-time)) 30 | 31 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L435 32 | (defn -is-midnight-end-of-day [this] (wip ::-is-midnight-end-of-day)) 33 | 34 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L447 35 | (defn -get-time-definition [this] (wip ::-get-time-definition)) 36 | 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L456 38 | (defn -get-standard-offset [this] (wip ::-get-standard-offset)) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L465 41 | (defn -get-offset-before [this] (wip ::-get-offset-before)) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L474 44 | (defn -get-offset-after [this] (wip ::-get-offset-after)) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L487 47 | (defn -create-transition [this year] (wip ::-create-transition)) 48 | 49 | (extend-type ZoneOffsetTransitionRule 50 | IZoneOffsetTransitionRule 51 | (getMonth [this] (-get-month this)) 52 | (getDayOfMonthIndicator [this] (-get-day-of-month-indicator this)) 53 | (getDayOfWeek [this] (-get-day-of-week this)) 54 | (getLocalTime [this] (-get-local-time this)) 55 | (isMidnightEndOfDay [this] (-is-midnight-end-of-day this)) 56 | (getTimeDefinition [this] (-get-time-definition this)) 57 | (getStandardOffset [this] (-get-standard-offset this)) 58 | (getOffsetBefore [this] (-get-offset-before this)) 59 | (getOffsetAfter [this] (-get-offset-after this)) 60 | (createTransition [this year] (-create-transition this year))) 61 | 62 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransitionRule.java#L172 63 | (defn of [month day-of-month-indicator day-of-week time time-end-of-day time-defnition standard-offset offset-before offset-after] (wip ::of)) 64 | -------------------------------------------------------------------------------- /src/jiffy/temporal/value_range.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.temporal.value-range 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java 5 | (defprotocol IValueRange 6 | (isFixed [this]) 7 | (getMinimum [this]) 8 | (getLargestMinimum [this]) 9 | (getSmallestMaximum [this]) 10 | (getMaximum [this]) 11 | (isIntValue [this]) 12 | (isValidValue [this value]) 13 | (isValidIntValue [this value]) 14 | (checkValidValue [this value field]) 15 | (checkValidIntValue [this value field])) 16 | 17 | (defrecord ValueRange []) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L203 20 | (defn -is-fixed [this] (wip ::-is-fixed)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L216 23 | (defn -get-minimum [this] (wip ::-get-minimum)) 24 | 25 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L228 26 | (defn -get-largest-minimum [this] (wip ::-get-largest-minimum)) 27 | 28 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L240 29 | (defn -get-smallest-maximum [this] (wip ::-get-smallest-maximum)) 30 | 31 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L252 32 | (defn -get-maximum [this] (wip ::-get-maximum)) 33 | 34 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L269 35 | (defn -is-int-value [this] (wip ::-is-int-value)) 36 | 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L281 38 | (defn -is-valid-value [this value] (wip ::-is-valid-value)) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L294 41 | (defn -is-valid-int-value [this value] (wip ::-is-valid-int-value)) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L309 44 | (defn -check-valid-value [this value field] (wip ::-check-valid-value)) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L328 47 | (defn -check-valid-int-value [this value field] (wip ::-check-valid-int-value)) 48 | 49 | (extend-type ValueRange 50 | IValueRange 51 | (isFixed [this] (-is-fixed this)) 52 | (getMinimum [this] (-get-minimum this)) 53 | (getLargestMinimum [this] (-get-largest-minimum this)) 54 | (getSmallestMaximum [this] (-get-smallest-maximum this)) 55 | (getMaximum [this] (-get-maximum this)) 56 | (isIntValue [this] (-is-int-value this)) 57 | (isValidValue [this value] (-is-valid-value this value)) 58 | (isValidIntValue [this value] (-is-valid-int-value this value)) 59 | (checkValidValue [this value field] (-check-valid-value this value field)) 60 | (checkValidIntValue [this value field] (-check-valid-int-value this value field))) 61 | 62 | (defn of 63 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L125 64 | ([min max] (wip ::of)) 65 | 66 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L146 67 | ([min max-smallest max-largest] (wip ::of)) 68 | 69 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/temporal/ValueRange.java#L165 70 | ([min-smallest min-largest max-smallest max-largest] (wip ::of))) 71 | -------------------------------------------------------------------------------- /src/jiffy/zone/zone_offset_transition.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.zone.zone-offset-transition 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable])) 4 | 5 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java 6 | (defprotocol IZoneOffsetTransition 7 | (getInstant [this]) 8 | (toEpochSecond [this]) 9 | (getDateTimeBefore [this]) 10 | (getDateTimeAfter [this]) 11 | (getOffsetBefore [this]) 12 | (getOffsetAfter [this]) 13 | (getDuration [this]) 14 | (isGap [this]) 15 | (isOverlap [this]) 16 | (isValidOffset [this offset]) 17 | (getValidOffsets [this])) 18 | 19 | (defrecord ZoneOffsetTransition []) 20 | 21 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L253 22 | (defn -get-instant [this] (wip ::-get-instant)) 23 | 24 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L262 25 | (defn -to-epoch-second [this] (wip ::-to-epoch-second)) 26 | 27 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L279 28 | (defn -get-date-time-before [this] (wip ::-get-date-time-before)) 29 | 30 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L293 31 | (defn -get-date-time-after [this] (wip ::-get-date-time-after)) 32 | 33 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L304 34 | (defn -get-offset-before [this] (wip ::-get-offset-before)) 35 | 36 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L315 37 | (defn -get-offset-after [this] (wip ::-get-offset-after)) 38 | 39 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L328 40 | (defn -get-duration [this] (wip ::-get-duration)) 41 | 42 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L350 43 | (defn -is-gap [this] (wip ::-is-gap)) 44 | 45 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L363 46 | (defn -is-overlap [this] (wip ::-is-overlap)) 47 | 48 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L377 49 | (defn -is-valid-offset [this offset] (wip ::-is-valid-offset)) 50 | 51 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L388 52 | (defn -get-valid-offsets [this] (wip ::-get-valid-offsets)) 53 | 54 | (extend-type ZoneOffsetTransition 55 | IZoneOffsetTransition 56 | (getInstant [this] (-get-instant this)) 57 | (toEpochSecond [this] (-to-epoch-second this)) 58 | (getDateTimeBefore [this] (-get-date-time-before this)) 59 | (getDateTimeAfter [this] (-get-date-time-after this)) 60 | (getOffsetBefore [this] (-get-offset-before this)) 61 | (getOffsetAfter [this] (-get-offset-after this)) 62 | (getDuration [this] (-get-duration this)) 63 | (isGap [this] (-is-gap this)) 64 | (isOverlap [this] (-is-overlap this)) 65 | (isValidOffset [this offset] (-is-valid-offset this offset)) 66 | (getValidOffsets [this] (-get-valid-offsets this))) 67 | 68 | ;; NB! This method is overloaded! 69 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L406 70 | (defn -compare-to [this compare-to--overloaded-param] (wip ::-compare-to)) 71 | 72 | (extend-type ZoneOffsetTransition 73 | TimeComparable/ITimeComparable 74 | (compareTo [this compare-to--overloaded-param] (-compare-to this compare-to--overloaded-param))) 75 | 76 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneOffsetTransition.java#L138 77 | (defn of [transition offset-before offset-after] (wip ::of)) 78 | -------------------------------------------------------------------------------- /src/jiffy/format/decimal_style.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.format.decimal-style 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java 5 | (defprotocol IDecimalStyle 6 | (getZeroDigit [this]) 7 | (withZeroDigit [this zero-digit]) 8 | (getPositiveSign [this]) 9 | (withPositiveSign [this positive-sign]) 10 | (getNegativeSign [this]) 11 | (withNegativeSign [this negative-sign]) 12 | (getDecimalSeparator [this]) 13 | (withDecimalSeparator [this decimal-separator]) 14 | (convertToDigit [this ch]) 15 | (convertNumberToI18N [this numeric-text])) 16 | 17 | (defrecord DecimalStyle []) 18 | 19 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L207 20 | (defn -get-zero-digit [this] (wip ::-get-zero-digit)) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L220 23 | (defn -with-zero-digit [this zero-digit] (wip ::-with-zero-digit)) 24 | 25 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L236 26 | (defn -get-positive-sign [this] (wip ::-get-positive-sign)) 27 | 28 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L249 29 | (defn -with-positive-sign [this positive-sign] (wip ::-with-positive-sign)) 30 | 31 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L265 32 | (defn -get-negative-sign [this] (wip ::-get-negative-sign)) 33 | 34 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L278 35 | (defn -with-negative-sign [this negative-sign] (wip ::-with-negative-sign)) 36 | 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L294 38 | (defn -get-decimal-separator [this] (wip ::-get-decimal-separator)) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L307 41 | (defn -with-decimal-separator [this decimal-separator] (wip ::-with-decimal-separator)) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L321 44 | (defn -convert-to-digit [this ch] (wip ::-convert-to-digit)) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L332 47 | (defn -convert-number-to-i18n [this numeric-text] (wip ::-convert-number-to-i18n)) 48 | 49 | (extend-type DecimalStyle 50 | IDecimalStyle 51 | (getZeroDigit [this] (-get-zero-digit this)) 52 | (withZeroDigit [this zero-digit] (-with-zero-digit this zero-digit)) 53 | (getPositiveSign [this] (-get-positive-sign this)) 54 | (withPositiveSign [this positive-sign] (-with-positive-sign this positive-sign)) 55 | (getNegativeSign [this] (-get-negative-sign this)) 56 | (withNegativeSign [this negative-sign] (-with-negative-sign this negative-sign)) 57 | (getDecimalSeparator [this] (-get-decimal-separator this)) 58 | (withDecimalSeparator [this decimal-separator] (-with-decimal-separator this decimal-separator)) 59 | (convertToDigit [this ch] (-convert-to-digit this ch)) 60 | (convertNumberToI18N [this numeric-text] (-convert-number-to-i18n this numeric-text))) 61 | 62 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L122 63 | (defn getAvailableLocales [] (wip ::getAvailableLocales)) 64 | 65 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L142 66 | (defn ofDefaultLocale [] (wip ::ofDefaultLocale)) 67 | 68 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L159 69 | (defn of [locale] (wip ::of)) 70 | 71 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DecimalStyle.java#L91 72 | (def STANDARD ::STANDARD--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/chrono/chronology.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.chronology 2 | (:refer-clojure :exclude [range ]) 3 | (:require [jiffy.dev.wip :refer [wip]] 4 | [jiffy.time-comparable :as TimeComparable])) 5 | 6 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java 7 | (defprotocol IChronology 8 | (getId [this]) 9 | (getCalendarType [this]) 10 | (date [this temporal] [this proleptic-year month day-of-month] [this era year-of-era month day-of-month]) 11 | (dateYearDay [this proleptic-year day-of-year] [this era year-of-era day-of-year]) 12 | (dateEpochDay [this epoch-day]) 13 | (dateNow [this] [this date-now--overloaded-param]) 14 | (localDateTime [this temporal]) 15 | (zonedDateTime [this temporal] [this instant zone]) 16 | (isLeapYear [this proleptic-year]) 17 | (prolepticYear [this era year-of-era]) 18 | (eraOf [this era-value]) 19 | (eras [this]) 20 | (range [this field]) 21 | (getDisplayName [this style locale]) 22 | (resolveDate [this field-values resolver-style]) 23 | (period [this years months days]) 24 | (epochSecond [this proleptic-year month day-of-month hour minute second zone-offset] [this era year-of-era month day-of-month hour minute second zone-offset])) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L316 27 | (defn -date [this era year-of-era month day-of-month] (wip ::-date)) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L347 30 | (defn -date-year-day [this era year-of-era day-of-year] (wip ::-date-year-day)) 31 | 32 | (defn -date-now 33 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L126 34 | ([this] (wip ::-date-now)) 35 | 36 | ;; NB! This method is overloaded! 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L410 38 | ([this date-now--overloaded-param] (wip ::-date-now))) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L475 41 | (defn -local-date-time [this temporal] (wip ::-local-date-time)) 42 | 43 | (defn -zoned-date-time 44 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L507 45 | ([this temporal] (wip ::-zoned-date-time)) 46 | 47 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L533 48 | ([this instant zone] (wip ::-zoned-date-time))) 49 | 50 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L645 51 | (defn -get-display-name [this style locale] (wip ::-get-display-name)) 52 | 53 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L716 54 | (defn -period [this years months days] (wip ::-period)) 55 | 56 | (defn -epoch-second 57 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L739 58 | ([this proleptic-year month day-of-month hour minute second zone-offset] (wip ::-epoch-second)) 59 | 60 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L768 61 | ([this era year-of-era month day-of-month hour minute second zone-offset] (wip ::-epoch-second))) 62 | 63 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L182 64 | (defn from [temporal] (wip ::from)) 65 | 66 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L229 67 | (defn ofLocale [locale] (wip ::ofLocale)) 68 | 69 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L254 70 | (defn of [id] (wip ::of)) 71 | 72 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/Chronology.java#L268 73 | (defn getAvailableChronologies [] (wip ::getAvailableChronologies)) 74 | -------------------------------------------------------------------------------- /src/jiffy/chrono/chrono_zoned_date_time_impl.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.chrono-zoned-date-time-impl 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.chrono-zoned-date-time :as ChronoZonedDateTime] 5 | [jiffy.temporal.temporal :as Temporal] 6 | [jiffy.temporal.temporal-accessor :as TemporalAccessor])) 7 | 8 | (defrecord ChronoZonedDateTimeImpl []) 9 | 10 | ;; FIXME: no implementation found from inherited class interface java.lang.Comparable 11 | 12 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L226 13 | (defn -get-offset [this] (wip ::-get-offset)) 14 | 15 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L231 16 | (defn -with-earlier-offset-at-overlap [this] (wip ::-with-earlier-offset-at-overlap)) 17 | 18 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L232 19 | (defn -get-zone [this] (wip ::-get-zone)) 20 | 21 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L243 22 | (defn -with-later-offset-at-overlap [this] (wip ::-with-later-offset-at-overlap)) 23 | 24 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L256 25 | (defn -to-local-date-time [this] (wip ::-to-local-date-time)) 26 | 27 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L266 28 | (defn -with-zone-same-local [this zone] (wip ::-with-zone-same-local)) 29 | 30 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L271 31 | (defn -with-zone-same-instant [this zone] (wip ::-with-zone-same-instant)) 32 | 33 | (extend-type ChronoZonedDateTimeImpl 34 | ChronoZonedDateTime/IChronoZonedDateTime 35 | (getOffset [this] (-get-offset this)) 36 | (withEarlierOffsetAtOverlap [this] (-with-earlier-offset-at-overlap this)) 37 | (getZone [this] (-get-zone this)) 38 | (withLaterOffsetAtOverlap [this] (-with-later-offset-at-overlap this)) 39 | (toLocalDateTime [this] (-to-local-date-time this)) 40 | (withZoneSameLocal [this zone] (-with-zone-same-local this zone)) 41 | (withZoneSameInstant [this zone] (-with-zone-same-instant this zone))) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L284 44 | (defn -with [this field new-value] (wip ::-with)) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L301 47 | (defn -plus [this amount-to-add unit] (wip ::-plus)) 48 | 49 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L310 50 | (defn -until [this end-exclusive unit] (wip ::-until)) 51 | 52 | (extend-type ChronoZonedDateTimeImpl 53 | Temporal/ITemporal 54 | (with [this field new-value] (-with this field new-value)) 55 | (plus [this amount-to-add unit] (-plus this amount-to-add unit)) 56 | (until [this end-exclusive unit] (-until this end-exclusive unit))) 57 | 58 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L278 59 | (defn -is-supported [this field] (wip ::-is-supported)) 60 | 61 | (extend-type ChronoZonedDateTimeImpl 62 | TemporalAccessor/ITemporalAccessor 63 | (isSupported [this field] (-is-supported this field))) 64 | 65 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L134 66 | (defn ofBest [local-date-time zone preferred-offset] (wip ::ofBest)) 67 | 68 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L170 69 | (defn ofInstant [chrono instant zone] (wip ::ofInstant)) 70 | 71 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java#L200 72 | (defn ensureValid [chrono temporal] (wip ::ensureValid)) 73 | -------------------------------------------------------------------------------- /src/jiffy/chrono/japanese_era.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.japanese-era 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.chrono.era :as Era] 4 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 5 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 6 | 7 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java 8 | (defprotocol IJapaneseEra 9 | (getPrivateEra [this]) 10 | (getAbbreviation [this]) 11 | (getName [this])) 12 | 13 | (defrecord JapaneseEra []) 14 | 15 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L190 16 | (defn -get-private-era [this] (wip ::-get-private-era)) 17 | 18 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L261 19 | (defn -get-abbreviation [this] (wip ::-get-abbreviation)) 20 | 21 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L261 22 | (defn -get-name [this] (wip ::-get-name)) 23 | 24 | (extend-type JapaneseEra 25 | IJapaneseEra 26 | (getPrivateEra [this] (-get-private-era this)) 27 | (getAbbreviation [this] (-get-abbreviation this)) 28 | (getName [this] (-get-name this))) 29 | 30 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L105 31 | (defn -get-value [this] (wip ::-get-value)) 32 | 33 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L256 34 | (defn -get-display-name [this style locale] (wip ::-get-display-name)) 35 | 36 | (extend-type JapaneseEra 37 | Era/IEra 38 | (getValue [this] (-get-value this)) 39 | (getDisplayName [this style locale] (-get-display-name this style locale))) 40 | 41 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L363 42 | (defn -range [this field] (wip ::-range)) 43 | 44 | (extend-type JapaneseEra 45 | TemporalAccessor/ITemporalAccessor 46 | (range [this field] (-range this field))) 47 | 48 | ;; FIXME: no implementation found from inherited class interface java.time.temporal.TemporalAdjuster 49 | 50 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L206 51 | (defn of [japanese-era] (wip ::of)) 52 | 53 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L224 54 | (defn valueOf [japanese-era] (wip ::valueOf)) 55 | 56 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L245 57 | (defn values [] (wip ::values)) 58 | 59 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L278 60 | (defn from [date] (wip ::from)) 61 | 62 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L291 63 | (defn toJapaneseEra [private-era] (wip ::toJapaneseEra)) 64 | 65 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L300 66 | (defn privateEraFrom [iso-date] (wip ::privateEraFrom)) 67 | 68 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L106 69 | (def ERA_OFFSET ::ERA_OFFSET--not-implemented) 70 | 71 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L108 72 | (def ERA_CONFIG ::ERA_CONFIG--not-implemented) 73 | 74 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L114 75 | (def MEIJI ::MEIJI--not-implemented) 76 | 77 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L119 78 | (def TAISHO ::TAISHO--not-implemented) 79 | 80 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L124 81 | (def SHOWA ::SHOWA--not-implemented) 82 | 83 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseEra.java#L129 84 | (def HEISEI ::HEISEI--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/zone/zone_rules.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.zone.zone-rules 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java 5 | (defprotocol IZoneRules 6 | (isFixedOffset [this]) 7 | (getOffset [this get-offset--overloaded-param]) 8 | (getValidOffsets [this local-date-time]) 9 | (getTransition [this local-date-time]) 10 | (getStandardOffset [this instant]) 11 | (getDaylightSavings [this instant]) 12 | (isDaylightSavings [this instant]) 13 | (isValidOffset [this local-date-time offset]) 14 | (nextTransition [this instant]) 15 | (previousTransition [this instant]) 16 | (getTransitions [this]) 17 | (getTransitionRules [this])) 18 | 19 | (defrecord ZoneRules []) 20 | 21 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L463 22 | (defn -is-fixed-offset [this] (wip ::-is-fixed-offset)) 23 | 24 | ;; NB! This method is overloaded! 25 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L478 26 | (defn -get-offset [this get-offset--overloaded-param] (wip ::-get-offset)) 27 | 28 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L585 29 | (defn -get-valid-offsets [this local-date-time] (wip ::-get-valid-offsets)) 30 | 31 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L628 32 | (defn -get-transition [this local-date-time] (wip ::-get-transition)) 33 | 34 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L749 35 | (defn -get-standard-offset [this instant] (wip ::-get-standard-offset)) 36 | 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L779 38 | (defn -get-daylight-savings [this instant] (wip ::-get-daylight-savings)) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L802 41 | (defn -is-daylight-savings [this instant] (wip ::-is-daylight-savings)) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L820 44 | (defn -is-valid-offset [this local-date-time offset] (wip ::-is-valid-offset)) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L835 47 | (defn -next-transition [this instant] (wip ::-next-transition)) 48 | 49 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L882 50 | (defn -previous-transition [this instant] (wip ::-previous-transition)) 51 | 52 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L942 53 | (defn -get-transitions [this] (wip ::-get-transitions)) 54 | 55 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L971 56 | (defn -get-transition-rules [this] (wip ::-get-transition-rules)) 57 | 58 | (extend-type ZoneRules 59 | IZoneRules 60 | (isFixedOffset [this] (-is-fixed-offset this)) 61 | (getOffset [this get-offset--overloaded-param] (-get-offset this get-offset--overloaded-param)) 62 | (getValidOffsets [this local-date-time] (-get-valid-offsets this local-date-time)) 63 | (getTransition [this local-date-time] (-get-transition this local-date-time)) 64 | (getStandardOffset [this instant] (-get-standard-offset this instant)) 65 | (getDaylightSavings [this instant] (-get-daylight-savings this instant)) 66 | (isDaylightSavings [this instant] (-is-daylight-savings this instant)) 67 | (isValidOffset [this local-date-time offset] (-is-valid-offset this local-date-time offset)) 68 | (nextTransition [this instant] (-next-transition this instant)) 69 | (previousTransition [this instant] (-previous-transition this instant)) 70 | (getTransitions [this] (-get-transitions this)) 71 | (getTransitionRules [this] (-get-transition-rules this))) 72 | 73 | (defn of 74 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L197 75 | ([offset] (wip ::of)) 76 | 77 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/zone/ZoneRules.java#L176 78 | ([base-standard-offset base-wall-offset standard-offset-transition-list transition-list last-rules] (wip ::of))) 79 | -------------------------------------------------------------------------------- /src/jiffy/zone_offset.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.zone-offset 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.zone-id :as ZoneId] 5 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 6 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 7 | 8 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java 9 | (defprotocol IZoneOffset 10 | (getTotalSeconds [this])) 11 | 12 | (defrecord ZoneOffset []) 13 | 14 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L473 15 | (defn -get-total-seconds [this] (wip ::-get-total-seconds)) 16 | 17 | (extend-type ZoneOffset 18 | IZoneOffset 19 | (getTotalSeconds [this] (-get-total-seconds this))) 20 | 21 | ;; NB! This method is overloaded! 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L703 23 | (defn -compare-to [this compare-to--overloaded-param] (wip ::-compare-to)) 24 | 25 | (extend-type ZoneOffset 26 | TimeComparable/ITimeComparable 27 | (compareTo [this compare-to--overloaded-param] (-compare-to this compare-to--overloaded-param))) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L491 30 | (defn -get-id [this] (wip ::-get-id)) 31 | 32 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L504 33 | (defn -get-rules [this] (wip ::-get-rules)) 34 | 35 | (extend-type ZoneOffset 36 | ZoneId/IZoneId 37 | (getId [this] (-get-id this)) 38 | (getRules [this] (-get-rules this))) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L529 41 | (defn -is-supported [this field] (wip ::-is-supported)) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L560 44 | (defn -range [this field] (wip ::-range)) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L590 47 | (defn -get [this field] (wip ::-get)) 48 | 49 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L622 50 | (defn -get-long [this field] (wip ::-get-long)) 51 | 52 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L652 53 | (defn -query [this query] (wip ::-query)) 54 | 55 | (extend-type ZoneOffset 56 | TemporalAccessor/ITemporalAccessor 57 | (isSupported [this field] (-is-supported this field)) 58 | (range [this field] (-range this field)) 59 | (get [this field] (-get this field)) 60 | (getLong [this field] (-get-long this field)) 61 | (query [this query] (-query this query))) 62 | 63 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L684 64 | (defn -adjust-into [this temporal] (wip ::-adjust-into)) 65 | 66 | (extend-type ZoneOffset 67 | TemporalAdjuster/ITemporalAdjuster 68 | (adjustInto [this temporal] (-adjust-into this temporal))) 69 | 70 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L202 71 | (defn of [offset-id] (wip ::of)) 72 | 73 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L282 74 | (defn ofHours [hours] (wip ::ofHours)) 75 | 76 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L299 77 | (defn ofHoursMinutes [hours minutes] (wip ::ofHoursMinutes)) 78 | 79 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L316 80 | (defn ofHoursMinutesSeconds [hours minutes seconds] (wip ::ofHoursMinutesSeconds)) 81 | 82 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L343 83 | (defn from [temporal] (wip ::from)) 84 | 85 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L413 86 | (defn ofTotalSeconds [total-seconds] (wip ::ofTotalSeconds)) 87 | 88 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L151 89 | (def UTC ::UTC--not-implemented) 90 | 91 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L155 92 | (def MIN ::MIN--not-implemented) 93 | 94 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/ZoneOffset.java#L159 95 | (def MAX ::MAX--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/chrono/chrono_local_date_impl.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.chrono-local-date-impl 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.chrono-local-date :as ChronoLocalDate] 5 | [jiffy.temporal.temporal :as Temporal] 6 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 7 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 8 | 9 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java 10 | (defprotocol IChronoLocalDateImpl 11 | (plusYears [this years-to-add]) 12 | (plusMonths [this months-to-add]) 13 | (plusWeeks [this weeks-to-add]) 14 | (plusDays [this days-to-add]) 15 | (minusYears [this years-to-subtract]) 16 | (minusMonths [this months-to-subtract]) 17 | (minusWeeks [this weeks-to-subtract]) 18 | (minusDays [this days-to-subtract])) 19 | 20 | (defrecord ChronoLocalDateImpl []) 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L243 23 | (defn -plus-years [this years-to-add] (wip ::-plus-years)) 24 | 25 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L259 26 | (defn -plus-months [this months-to-add] (wip ::-plus-months)) 27 | 28 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L276 29 | (defn -plus-weeks [this weeks-to-add] (wip ::-plus-weeks)) 30 | 31 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L291 32 | (defn -plus-days [this days-to-add] (wip ::-plus-days)) 33 | 34 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L311 35 | (defn -minus-years [this years-to-subtract] (wip ::-minus-years)) 36 | 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L332 38 | (defn -minus-months [this months-to-subtract] (wip ::-minus-months)) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L352 41 | (defn -minus-weeks [this weeks-to-subtract] (wip ::-minus-weeks)) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L370 44 | (defn -minus-days [this days-to-subtract] (wip ::-minus-days)) 45 | 46 | (extend-type ChronoLocalDateImpl 47 | IChronoLocalDateImpl 48 | (plusYears [this years-to-add] (-plus-years this years-to-add)) 49 | (plusMonths [this months-to-add] (-plus-months this months-to-add)) 50 | (plusWeeks [this weeks-to-add] (-plus-weeks this weeks-to-add)) 51 | (plusDays [this days-to-add] (-plus-days this days-to-add)) 52 | (minusYears [this years-to-subtract] (-minus-years this years-to-subtract)) 53 | (minusMonths [this months-to-subtract] (-minus-months this months-to-subtract)) 54 | (minusWeeks [this weeks-to-subtract] (-minus-weeks this weeks-to-subtract)) 55 | (minusDays [this days-to-subtract] (-minus-days this days-to-subtract))) 56 | 57 | ;; FIXME: no implementation found from inherited class interface java.lang.Comparable 58 | 59 | ;; FIXME: no implementation found from inherited class interface java.time.chrono.ChronoLocalDate 60 | 61 | (defn -with 62 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L178 63 | ([this adjuster] (wip ::-with)) 64 | 65 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L184 66 | ([this field value] (wip ::-with))) 67 | 68 | (defn -plus 69 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L191 70 | ([this amount] (wip ::-plus)) 71 | 72 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L198 73 | ([this amount-to-add unit] (wip ::-plus))) 74 | 75 | (defn -minus 76 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L218 77 | ([this amount] (wip ::-minus)) 78 | 79 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L224 80 | ([this amount-to-subtract unit] (wip ::-minus))) 81 | 82 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L376 83 | (defn -until [this end-exclusive unit] (wip ::-until)) 84 | 85 | (extend-type ChronoLocalDateImpl 86 | Temporal/ITemporal 87 | (with 88 | ([this adjuster] (-with this adjuster)) 89 | ([this field value] (-with this field value))) 90 | (plus 91 | ([this amount] (-plus this amount)) 92 | ([this amount-to-add unit] (-plus this amount-to-add unit))) 93 | (minus 94 | ([this amount] (-minus this amount)) 95 | ([this amount-to-subtract unit] (-minus this amount-to-subtract unit))) 96 | (until [this end-exclusive unit] (-until this end-exclusive unit))) 97 | 98 | ;; FIXME: no implementation found from inherited class interface java.time.temporal.TemporalAccessor 99 | 100 | ;; FIXME: no implementation found from inherited class interface java.time.temporal.TemporalAdjuster 101 | 102 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateImpl.java#L160 103 | (defn ensureValid [chrono temporal] (wip ::ensureValid)) 104 | -------------------------------------------------------------------------------- /src/jiffy/chrono/abstract_chronology.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.abstract-chronology 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.chronology :as Chronology])) 5 | 6 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java 7 | (defprotocol IAbstractChronology 8 | (resolveProlepticMonth [this field-values resolver-style]) 9 | (resolveYearOfEra [this field-values resolver-style]) 10 | (resolveYMD [this field-values resolver-style]) 11 | (resolveYD [this field-values resolver-style]) 12 | (resolveYMAA [this field-values resolver-style]) 13 | (resolveYMAD [this field-values resolver-style]) 14 | (resolveYAA [this field-values resolver-style]) 15 | (resolveYAD [this field-values resolver-style]) 16 | (resolveAligned [this base months weeks dow]) 17 | (addFieldValue [this field-values field value])) 18 | 19 | (defrecord AbstractChronology []) 20 | 21 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L468 22 | (defn -resolve-proleptic-month [this field-values resolver-style] (wip ::-resolve-proleptic-month)) 23 | 24 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L483 25 | (defn -resolve-year-of-era [this field-values resolver-style] (wip ::-resolve-year-of-era)) 26 | 27 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L521 28 | (defn -resolve-ymd [this field-values resolver-style] (wip ::-resolve-ymd)) 29 | 30 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L541 31 | (defn -resolve-yd [this field-values resolver-style] (wip ::-resolve-yd)) 32 | 33 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L551 34 | (defn -resolve-ymaa [this field-values resolver-style] (wip ::-resolve-ymaa)) 35 | 36 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L569 37 | (defn -resolve-ymad [this field-values resolver-style] (wip ::-resolve-ymad)) 38 | 39 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L587 40 | (defn -resolve-yaa [this field-values resolver-style] (wip ::-resolve-yaa)) 41 | 42 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L603 43 | (defn -resolve-yad [this field-values resolver-style] (wip ::-resolve-yad)) 44 | 45 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L619 46 | (defn -resolve-aligned [this base months weeks dow] (wip ::-resolve-aligned)) 47 | 48 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L643 49 | (defn -add-field-value [this field-values field value] (wip ::-add-field-value)) 50 | 51 | (extend-type AbstractChronology 52 | IAbstractChronology 53 | (resolveProlepticMonth [this field-values resolver-style] (-resolve-proleptic-month this field-values resolver-style)) 54 | (resolveYearOfEra [this field-values resolver-style] (-resolve-year-of-era this field-values resolver-style)) 55 | (resolveYMD [this field-values resolver-style] (-resolve-ymd this field-values resolver-style)) 56 | (resolveYD [this field-values resolver-style] (-resolve-yd this field-values resolver-style)) 57 | (resolveYMAA [this field-values resolver-style] (-resolve-ymaa this field-values resolver-style)) 58 | (resolveYMAD [this field-values resolver-style] (-resolve-ymad this field-values resolver-style)) 59 | (resolveYAA [this field-values resolver-style] (-resolve-yaa this field-values resolver-style)) 60 | (resolveYAD [this field-values resolver-style] (-resolve-yad this field-values resolver-style)) 61 | (resolveAligned [this base months weeks dow] (-resolve-aligned this base months weeks dow)) 62 | (addFieldValue [this field-values field value] (-add-field-value this field-values field value))) 63 | 64 | ;; NB! This method is overloaded! 65 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L667 66 | (defn -compare-to [this compare-to--overloaded-param] (wip ::-compare-to)) 67 | 68 | (extend-type AbstractChronology 69 | TimeComparable/ITimeComparable 70 | (compareTo [this compare-to--overloaded-param] (-compare-to this compare-to--overloaded-param))) 71 | 72 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L423 73 | (defn -resolve-date [this field-values resolver-style] (wip ::-resolve-date)) 74 | 75 | (extend-type AbstractChronology 76 | Chronology/IChronology 77 | (resolveDate [this field-values resolver-style] (-resolve-date this field-values resolver-style))) 78 | 79 | (defn registerChrono 80 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L146 81 | ([chrono] (wip ::registerChrono)) 82 | 83 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L159 84 | ([chrono id] (wip ::registerChrono))) 85 | 86 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L224 87 | (defn ofLocale [locale] (wip ::ofLocale)) 88 | 89 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L262 90 | (defn of [id] (wip ::of)) 91 | 92 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/AbstractChronology.java#L309 93 | (defn getAvailableChronologies [] (wip ::getAvailableChronologies)) 94 | -------------------------------------------------------------------------------- /src/jiffy/chrono/minguo_chronology.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.minguo-chronology 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.abstract-chronology :as AbstractChronology] 5 | [jiffy.chrono.chronology :as Chronology])) 6 | 7 | (defrecord MinguoChronology []) 8 | 9 | ;; FIXME: no implementation found from inherited class interface java.lang.Comparable 10 | 11 | ;; FIXME: no implementation found from inherited class class java.time.chrono.AbstractChronology 12 | 13 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L140 14 | (defn -get-id [this] (wip ::-get-id)) 15 | 16 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L157 17 | (defn -get-calendar-type [this] (wip ::-get-calendar-type)) 18 | 19 | (defn -date 20 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L252 21 | ([this temporal] (wip ::-date)) 22 | 23 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L190 24 | ([this proleptic-year month day-of-month] (wip ::-date)) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L175 27 | ([this era year-of-era month day-of-month] (wip ::-date))) 28 | 29 | (defn -date-year-day 30 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L220 31 | ([this proleptic-year day-of-year] (wip ::-date-year-day)) 32 | 33 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L206 34 | ([this era year-of-era day-of-year] (wip ::-date-year-day))) 35 | 36 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L232 37 | (defn -date-epoch-day [this epoch-day] (wip ::-date-epoch-day)) 38 | 39 | (defn -date-now 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L237 41 | ([this] (wip ::-date-now)) 42 | 43 | ;; NB! This method is overloaded! 44 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L242 45 | ([this date-now--overloaded-param] (wip ::-date-now))) 46 | 47 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L261 48 | (defn -local-date-time [this temporal] (wip ::-local-date-time)) 49 | 50 | (defn -zoned-date-time 51 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L267 52 | ([this temporal] (wip ::-zoned-date-time)) 53 | 54 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L273 55 | ([this instant zone] (wip ::-zoned-date-time))) 56 | 57 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L289 58 | (defn -is-leap-year [this proleptic-year] (wip ::-is-leap-year)) 59 | 60 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L294 61 | (defn -proleptic-year [this era year-of-era] (wip ::-proleptic-year)) 62 | 63 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L302 64 | (defn -era-of [this era-value] (wip ::-era-of)) 65 | 66 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L307 67 | (defn -eras [this] (wip ::-eras)) 68 | 69 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L313 70 | (defn -range [this field] (wip ::-range)) 71 | 72 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L333 73 | (defn -resolve-date [this field-values resolver-style] (wip ::-resolve-date)) 74 | 75 | (extend-type MinguoChronology 76 | Chronology/IChronology 77 | (getId [this] (-get-id this)) 78 | (getCalendarType [this] (-get-calendar-type this)) 79 | (date 80 | ([this temporal] (-date this temporal)) 81 | ([this proleptic-year month day-of-month] (-date this proleptic-year month day-of-month)) 82 | ([this era year-of-era month day-of-month] (-date this era year-of-era month day-of-month))) 83 | (dateYearDay 84 | ([this proleptic-year day-of-year] (-date-year-day this proleptic-year day-of-year)) 85 | ([this era year-of-era day-of-year] (-date-year-day this era year-of-era day-of-year))) 86 | (dateEpochDay [this epoch-day] (-date-epoch-day this epoch-day)) 87 | (dateNow 88 | ([this] (-date-now this)) 89 | ([this date-now--overloaded-param] (-date-now this date-now--overloaded-param))) 90 | (localDateTime [this temporal] (-local-date-time this temporal)) 91 | (zonedDateTime 92 | ([this temporal] (-zoned-date-time this temporal)) 93 | ([this instant zone] (-zoned-date-time this instant zone))) 94 | (isLeapYear [this proleptic-year] (-is-leap-year this proleptic-year)) 95 | (prolepticYear [this era year-of-era] (-proleptic-year this era year-of-era)) 96 | (eraOf [this era-value] (-era-of this era-value)) 97 | (eras [this] (-eras this)) 98 | (range [this field] (-range this field)) 99 | (resolveDate [this field-values resolver-style] (-resolve-date this field-values resolver-style))) 100 | 101 | 102 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L112 103 | (def INSTANCE ::INSTANCE--not-implemented) 104 | 105 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoChronology.java#L121 106 | (def YEARS_DIFFERENCE ::YEARS_DIFFERENCE--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/chrono/thai_buddhist_chronology.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.thai-buddhist-chronology 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.abstract-chronology :as AbstractChronology] 5 | [jiffy.chrono.chronology :as Chronology])) 6 | 7 | (defrecord ThaiBuddhistChronology []) 8 | 9 | ;; FIXME: no implementation found from inherited class interface java.lang.Comparable 10 | 11 | ;; FIXME: no implementation found from inherited class class java.time.chrono.AbstractChronology 12 | 13 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L177 14 | (defn -get-id [this] (wip ::-get-id)) 15 | 16 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L194 17 | (defn -get-calendar-type [this] (wip ::-get-calendar-type)) 18 | 19 | (defn -date 20 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L289 21 | ([this temporal] (wip ::-date)) 22 | 23 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L227 24 | ([this proleptic-year month day-of-month] (wip ::-date)) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L212 27 | ([this era year-of-era month day-of-month] (wip ::-date))) 28 | 29 | (defn -date-year-day 30 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L257 31 | ([this proleptic-year day-of-year] (wip ::-date-year-day)) 32 | 33 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L243 34 | ([this era year-of-era day-of-year] (wip ::-date-year-day))) 35 | 36 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L269 37 | (defn -date-epoch-day [this epoch-day] (wip ::-date-epoch-day)) 38 | 39 | (defn -date-now 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L274 41 | ([this] (wip ::-date-now)) 42 | 43 | ;; NB! This method is overloaded! 44 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L279 45 | ([this date-now--overloaded-param] (wip ::-date-now))) 46 | 47 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L298 48 | (defn -local-date-time [this temporal] (wip ::-local-date-time)) 49 | 50 | (defn -zoned-date-time 51 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L304 52 | ([this temporal] (wip ::-zoned-date-time)) 53 | 54 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L310 55 | ([this instant zone] (wip ::-zoned-date-time))) 56 | 57 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L326 58 | (defn -is-leap-year [this proleptic-year] (wip ::-is-leap-year)) 59 | 60 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L331 61 | (defn -proleptic-year [this era year-of-era] (wip ::-proleptic-year)) 62 | 63 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L339 64 | (defn -era-of [this era-value] (wip ::-era-of)) 65 | 66 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L344 67 | (defn -eras [this] (wip ::-eras)) 68 | 69 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L350 70 | (defn -range [this field] (wip ::-range)) 71 | 72 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L370 73 | (defn -resolve-date [this field-values resolver-style] (wip ::-resolve-date)) 74 | 75 | (extend-type ThaiBuddhistChronology 76 | Chronology/IChronology 77 | (getId [this] (-get-id this)) 78 | (getCalendarType [this] (-get-calendar-type this)) 79 | (date 80 | ([this temporal] (-date this temporal)) 81 | ([this proleptic-year month day-of-month] (-date this proleptic-year month day-of-month)) 82 | ([this era year-of-era month day-of-month] (-date this era year-of-era month day-of-month))) 83 | (dateYearDay 84 | ([this proleptic-year day-of-year] (-date-year-day this proleptic-year day-of-year)) 85 | ([this era year-of-era day-of-year] (-date-year-day this era year-of-era day-of-year))) 86 | (dateEpochDay [this epoch-day] (-date-epoch-day this epoch-day)) 87 | (dateNow 88 | ([this] (-date-now this)) 89 | ([this date-now--overloaded-param] (-date-now this date-now--overloaded-param))) 90 | (localDateTime [this temporal] (-local-date-time this temporal)) 91 | (zonedDateTime 92 | ([this temporal] (-zoned-date-time this temporal)) 93 | ([this instant zone] (-zoned-date-time this instant zone))) 94 | (isLeapYear [this proleptic-year] (-is-leap-year this proleptic-year)) 95 | (prolepticYear [this era year-of-era] (-proleptic-year this era year-of-era)) 96 | (eraOf [this era-value] (-era-of this era-value)) 97 | (eras [this] (-eras this)) 98 | (range [this field] (-range this field)) 99 | (resolveDate [this field-values resolver-style] (-resolve-date this field-values resolver-style))) 100 | 101 | 102 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L114 103 | (def INSTANCE ::INSTANCE--not-implemented) 104 | 105 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistChronology.java#L123 106 | (def YEARS_DIFFERENCE ::YEARS_DIFFERENCE--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/month_day.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.month-day 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 5 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 6 | 7 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java 8 | (defprotocol IMonthDay 9 | (getMonth [this]) 10 | (getMonthValue [this]) 11 | (getDayOfMonth [this]) 12 | (isValidYear [this year]) 13 | (withMonth [this month]) 14 | (with [this month]) 15 | (withDayOfMonth [this day-of-month]) 16 | (format [this formatter]) 17 | (atYear [this year]) 18 | (isAfter [this other]) 19 | (isBefore [this other])) 20 | 21 | (defrecord MonthDay []) 22 | 23 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L384 24 | (defn -get-month [this] (wip ::-get-month)) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L467 27 | (defn -get-month-value [this] (wip ::-get-month-value)) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L493 30 | (defn -get-day-of-month [this] (wip ::-get-day-of-month)) 31 | 32 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L508 33 | (defn -is-valid-year [this year] (wip ::-is-valid-year)) 34 | 35 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L526 36 | (defn -with-month [this month] (wip ::-with-month)) 37 | 38 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L542 39 | (defn -with [this month] (wip ::-with)) 40 | 41 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L564 42 | (defn -with-day-of-month [this day-of-month] (wip ::-with-day-of-month)) 43 | 44 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L644 45 | (defn -format [this formatter] (wip ::-format)) 46 | 47 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L664 48 | (defn -at-year [this year] (wip ::-at-year)) 49 | 50 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L693 51 | (defn -is-after [this other] (wip ::-is-after)) 52 | 53 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L703 54 | (defn -is-before [this other] (wip ::-is-before)) 55 | 56 | (extend-type MonthDay 57 | IMonthDay 58 | (getMonth [this] (-get-month this)) 59 | (getMonthValue [this] (-get-month-value this)) 60 | (getDayOfMonth [this] (-get-day-of-month this)) 61 | (isValidYear [this year] (-is-valid-year this year)) 62 | (withMonth [this month] (-with-month this month)) 63 | (with [this month] (-with this month)) 64 | (withDayOfMonth [this day-of-month] (-with-day-of-month this day-of-month)) 65 | (format [this formatter] (-format this formatter)) 66 | (atYear [this year] (-at-year this year)) 67 | (isAfter [this other] (-is-after this other)) 68 | (isBefore [this other] (-is-before this other))) 69 | 70 | ;; NB! This method is overloaded! 71 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L679 72 | (defn -compare-to [this compare-to--overloaded-param] (wip ::-compare-to)) 73 | 74 | (extend-type MonthDay 75 | TimeComparable/ITimeComparable 76 | (compareTo [this compare-to--overloaded-param] (-compare-to this compare-to--overloaded-param))) 77 | 78 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L349 79 | (defn -is-supported [this field] (wip ::-is-supported)) 80 | 81 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L380 82 | (defn -range [this field] (wip ::-range)) 83 | 84 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L416 85 | (defn -get [this field] (wip ::-get)) 86 | 87 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L444 88 | (defn -get-long [this field] (wip ::-get-long)) 89 | 90 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L592 91 | (defn -query [this query] (wip ::-query)) 92 | 93 | (extend-type MonthDay 94 | TemporalAccessor/ITemporalAccessor 95 | (isSupported [this field] (-is-supported this field)) 96 | (range [this field] (-range this field)) 97 | (get [this field] (-get this field)) 98 | (getLong [this field] (-get-long this field)) 99 | (query [this query] (-query this query))) 100 | 101 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L627 102 | (defn -adjust-into [this temporal] (wip ::-adjust-into)) 103 | 104 | (extend-type MonthDay 105 | TemporalAdjuster/ITemporalAdjuster 106 | (adjustInto [this temporal] (-adjust-into this temporal))) 107 | 108 | (defn now 109 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L165 110 | ([] (wip ::now)) 111 | 112 | ;; NB! This method is overloaded! 113 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L181 114 | ([now--overloaded-param] (wip ::now))) 115 | 116 | ;; NB! This method is overloaded! 117 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L217 118 | (defn of [of--overloaded-param-1 of--overloaded-param-2] (wip ::of)) 119 | 120 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L267 121 | (defn from [temporal] (wip ::from)) 122 | 123 | (defn parse 124 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L293 125 | ([text] (wip ::parse)) 126 | 127 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/MonthDay.java#L307 128 | ([text formatter] (wip ::parse))) 129 | -------------------------------------------------------------------------------- /src/jiffy/format/date_time_parse_context.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.format.date-time-parse-context 2 | (:require [jiffy.dev.wip :refer [wip]])) 3 | 4 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java 5 | (defprotocol IDateTimeParseContext 6 | (copy [this]) 7 | (getLocale [this]) 8 | (getDecimalStyle [this]) 9 | (getEffectiveChronology [this]) 10 | (isCaseSensitive [this]) 11 | (setCaseSensitive [this case-sensitive]) 12 | (subSequenceEquals [this cs1 offset1 cs2 offset2 length]) 13 | (charEquals [this ch1 ch2]) 14 | (isStrict [this]) 15 | (setStrict [this strict]) 16 | (startOptional [this]) 17 | (endOptional [this successful]) 18 | (toUnresolved [this]) 19 | (toResolved [this resolver-style resolver-fields]) 20 | (getParsed [this field]) 21 | (setParsedField [this field value error-pos success-pos]) 22 | (setParsed [this set-parsed--overloaded-param]) 23 | (addChronoChangedListener [this listener]) 24 | (setParsedLeapSecond [this])) 25 | 26 | (defrecord DateTimeParseContext []) 27 | 28 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L130 29 | (defn -copy [this] (wip ::-copy)) 30 | 31 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L146 32 | (defn -get-locale [this] (wip ::-get-locale)) 33 | 34 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L157 35 | (defn -get-decimal-style [this] (wip ::-get-decimal-style)) 36 | 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L166 38 | (defn -get-effective-chronology [this] (wip ::-get-effective-chronology)) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L183 41 | (defn -is-case-sensitive [this] (wip ::-is-case-sensitive)) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L192 44 | (defn -set-case-sensitive [this case-sensitive] (wip ::-set-case-sensitive)) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L208 47 | (defn -sub-sequence-equals [this cs1 offset1 cs2 offset2 length] (wip ::-sub-sequence-equals)) 48 | 49 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L241 50 | (defn -char-equals [this ch1 ch2] (wip ::-char-equals)) 51 | 52 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L269 53 | (defn -is-strict [this] (wip ::-is-strict)) 54 | 55 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L278 56 | (defn -set-strict [this strict] (wip ::-set-strict)) 57 | 58 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L286 59 | (defn -start-optional [this] (wip ::-start-optional)) 60 | 61 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L295 62 | (defn -end-optional [this successful] (wip ::-end-optional)) 63 | 64 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L318 65 | (defn -to-unresolved [this] (wip ::-to-unresolved)) 66 | 67 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L327 68 | (defn -to-resolved [this resolver-style resolver-fields] (wip ::-to-resolved)) 69 | 70 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L347 71 | (defn -get-parsed [this field] (wip ::-get-parsed)) 72 | 73 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L363 74 | (defn -set-parsed-field [this field value error-pos success-pos] (wip ::-set-parsed-field)) 75 | 76 | ;; NB! This method is overloaded! 77 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L381 78 | (defn -set-parsed [this set-parsed--overloaded-param] (wip ::-set-parsed)) 79 | 80 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L400 81 | (defn -add-chrono-changed-listener [this listener] (wip ::-add-chrono-changed-listener)) 82 | 83 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L423 84 | (defn -set-parsed-leap-second [this] (wip ::-set-parsed-leap-second)) 85 | 86 | (extend-type DateTimeParseContext 87 | IDateTimeParseContext 88 | (copy [this] (-copy this)) 89 | (getLocale [this] (-get-locale this)) 90 | (getDecimalStyle [this] (-get-decimal-style this)) 91 | (getEffectiveChronology [this] (-get-effective-chronology this)) 92 | (isCaseSensitive [this] (-is-case-sensitive this)) 93 | (setCaseSensitive [this case-sensitive] (-set-case-sensitive this case-sensitive)) 94 | (subSequenceEquals [this cs1 offset1 cs2 offset2 length] (-sub-sequence-equals this cs1 offset1 cs2 offset2 length)) 95 | (charEquals [this ch1 ch2] (-char-equals this ch1 ch2)) 96 | (isStrict [this] (-is-strict this)) 97 | (setStrict [this strict] (-set-strict this strict)) 98 | (startOptional [this] (-start-optional this)) 99 | (endOptional [this successful] (-end-optional this successful)) 100 | (toUnresolved [this] (-to-unresolved this)) 101 | (toResolved [this resolver-style resolver-fields] (-to-resolved this resolver-style resolver-fields)) 102 | (getParsed [this field] (-get-parsed this field)) 103 | (setParsedField [this field value error-pos success-pos] (-set-parsed-field this field value error-pos success-pos)) 104 | (setParsed [this set-parsed--overloaded-param] (-set-parsed this set-parsed--overloaded-param)) 105 | (addChronoChangedListener [this listener] (-add-chrono-changed-listener this listener)) 106 | (setParsedLeapSecond [this] (-set-parsed-leap-second this))) 107 | 108 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/format/DateTimeParseContext.java#L255 109 | (defn charEqualsIgnoreCase [c1 c2] (wip ::charEqualsIgnoreCase)) 110 | -------------------------------------------------------------------------------- /src/jiffy/chrono/chrono_local_date_time_impl.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.chrono-local-date-time-impl 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.chrono-local-date-time :as ChronoLocalDateTime] 5 | [jiffy.temporal.temporal :as Temporal] 6 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 7 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 8 | 9 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java 10 | (defprotocol IChronoLocalDateTimeImpl 11 | (plusSeconds [this seconds])) 12 | 13 | (defrecord ChronoLocalDateTimeImpl []) 14 | 15 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L333 16 | (defn -plus-seconds [this seconds] (wip ::-plus-seconds)) 17 | 18 | (extend-type ChronoLocalDateTimeImpl 19 | IChronoLocalDateTimeImpl 20 | (plusSeconds [this seconds] (-plus-seconds this seconds))) 21 | 22 | ;; FIXME: no implementation found from inherited class interface java.lang.Comparable 23 | 24 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L228 25 | (defn -to-local-date [this] (wip ::-to-local-date)) 26 | 27 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L233 28 | (defn -to-local-time [this] (wip ::-to-local-time)) 29 | 30 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L365 31 | (defn -at-zone [this zone] (wip ::-at-zone)) 32 | 33 | (extend-type ChronoLocalDateTimeImpl 34 | ChronoLocalDateTime/IChronoLocalDateTime 35 | (toLocalDate [this] (-to-local-date this)) 36 | (toLocalTime [this] (-to-local-time this)) 37 | (atZone [this zone] (-at-zone this zone))) 38 | 39 | (defn -with 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L277 41 | ([this adjuster] (wip ::-with)) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L217 44 | ([this new-date new-time] (wip ::-with))) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L304 47 | (defn -plus [this amount-to-add unit] (wip ::-plus)) 48 | 49 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L371 50 | (defn -until [this end-exclusive unit] (wip ::-until)) 51 | 52 | (extend-type ChronoLocalDateTimeImpl 53 | Temporal/ITemporal 54 | (with 55 | ([this adjuster] (-with this adjuster)) 56 | ([this new-date new-time] (-with this new-date new-time))) 57 | (plus [this amount-to-add unit] (-plus this amount-to-add unit)) 58 | (until [this end-exclusive unit] (-until this end-exclusive unit))) 59 | 60 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L239 61 | (defn -is-supported [this field] (wip ::-is-supported)) 62 | 63 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L248 64 | (defn -range [this field] (wip ::-range)) 65 | 66 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L257 67 | (defn -get [this field] (wip ::-get)) 68 | 69 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L266 70 | (defn -get-long [this field] (wip ::-get-long)) 71 | 72 | (extend-type ChronoLocalDateTimeImpl 73 | TemporalAccessor/ITemporalAccessor 74 | (isSupported [this field] (-is-supported this field)) 75 | (range [this field] (-range this field)) 76 | (get [this field] (-get this field)) 77 | (getLong [this field] (-get-long this field))) 78 | 79 | ;; FIXME: no implementation found from inherited class interface java.time.temporal.TemporalAdjuster 80 | 81 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L173 82 | (defn of [date time] (wip ::of)) 83 | 84 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L186 85 | (defn ensureValid [chrono temporal] (wip ::ensureValid)) 86 | 87 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L110 88 | (def HOURS_PER_DAY ::HOURS_PER_DAY--not-implemented) 89 | 90 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L114 91 | (def MINUTES_PER_HOUR ::MINUTES_PER_HOUR--not-implemented) 92 | 93 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L118 94 | (def MINUTES_PER_DAY ::MINUTES_PER_DAY--not-implemented) 95 | 96 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L122 97 | (def SECONDS_PER_MINUTE ::SECONDS_PER_MINUTE--not-implemented) 98 | 99 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L126 100 | (def SECONDS_PER_HOUR ::SECONDS_PER_HOUR--not-implemented) 101 | 102 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L130 103 | (def SECONDS_PER_DAY ::SECONDS_PER_DAY--not-implemented) 104 | 105 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L134 106 | (def MILLIS_PER_DAY ::MILLIS_PER_DAY--not-implemented) 107 | 108 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L138 109 | (def MICROS_PER_DAY ::MICROS_PER_DAY--not-implemented) 110 | 111 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L142 112 | (def NANOS_PER_SECOND ::NANOS_PER_SECOND--not-implemented) 113 | 114 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L146 115 | (def NANOS_PER_MINUTE ::NANOS_PER_MINUTE--not-implemented) 116 | 117 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L150 118 | (def NANOS_PER_HOUR ::NANOS_PER_HOUR--not-implemented) 119 | 120 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java#L154 121 | (def NANOS_PER_DAY ::NANOS_PER_DAY--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/chrono/japanese_chronology.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.japanese-chronology 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.abstract-chronology :as AbstractChronology] 5 | [jiffy.chrono.chronology :as Chronology])) 6 | 7 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java 8 | (defprotocol IJapaneseChronology 9 | (getCurrentEra [this])) 10 | 11 | (defrecord JapaneseChronology []) 12 | 13 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L384 14 | (defn -get-current-era [this] (wip ::-get-current-era)) 15 | 16 | (extend-type JapaneseChronology 17 | IJapaneseChronology 18 | (getCurrentEra [this] (-get-current-era this))) 19 | 20 | ;; FIXME: no implementation found from inherited class interface java.lang.Comparable 21 | 22 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L428 23 | (defn -resolve-year-of-era [this field-values resolver-style] (wip ::-resolve-year-of-era)) 24 | 25 | (extend-type JapaneseChronology 26 | AbstractChronology/IAbstractChronology 27 | (resolveYearOfEra [this field-values resolver-style] (-resolve-year-of-era this field-values resolver-style))) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L158 30 | (defn -get-id [this] (wip ::-get-id)) 31 | 32 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L175 33 | (defn -get-calendar-type [this] (wip ::-get-calendar-type)) 34 | 35 | (defn -date 36 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L301 37 | ([this temporal] (wip ::-date)) 38 | 39 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L224 40 | ([this proleptic-year month day-of-month] (wip ::-date)) 41 | 42 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L203 43 | ([this era year-of-era month day-of-month] (wip ::-date))) 44 | 45 | (defn -date-year-day 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L269 47 | ([this proleptic-year day-of-year] (wip ::-date-year-day)) 48 | 49 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L251 50 | ([this era year-of-era day-of-year] (wip ::-date-year-day))) 51 | 52 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L281 53 | (defn -date-epoch-day [this epoch-day] (wip ::-date-epoch-day)) 54 | 55 | (defn -date-now 56 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L286 57 | ([this] (wip ::-date-now)) 58 | 59 | ;; NB! This method is overloaded! 60 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L291 61 | ([this date-now--overloaded-param] (wip ::-date-now))) 62 | 63 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L310 64 | (defn -local-date-time [this temporal] (wip ::-local-date-time)) 65 | 66 | (defn -zoned-date-time 67 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L316 68 | ([this temporal] (wip ::-zoned-date-time)) 69 | 70 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L322 71 | ([this instant zone] (wip ::-zoned-date-time))) 72 | 73 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L338 74 | (defn -is-leap-year [this proleptic-year] (wip ::-is-leap-year)) 75 | 76 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L343 77 | (defn -proleptic-year [this era year-of-era] (wip ::-proleptic-year)) 78 | 79 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L353 80 | (defn -eras [this] (wip ::-eras)) 81 | 82 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L375 83 | (defn -era-of [this era-value] (wip ::-era-of)) 84 | 85 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L392 86 | (defn -range [this field] (wip ::-range)) 87 | 88 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L423 89 | (defn -resolve-date [this field-values resolver-style] (wip ::-resolve-date)) 90 | 91 | (extend-type JapaneseChronology 92 | Chronology/IChronology 93 | (getId [this] (-get-id this)) 94 | (getCalendarType [this] (-get-calendar-type this)) 95 | (date 96 | ([this temporal] (-date this temporal)) 97 | ([this proleptic-year month day-of-month] (-date this proleptic-year month day-of-month)) 98 | ([this era year-of-era month day-of-month] (-date this era year-of-era month day-of-month))) 99 | (dateYearDay 100 | ([this proleptic-year day-of-year] (-date-year-day this proleptic-year day-of-year)) 101 | ([this era year-of-era day-of-year] (-date-year-day this era year-of-era day-of-year))) 102 | (dateEpochDay [this epoch-day] (-date-epoch-day this epoch-day)) 103 | (dateNow 104 | ([this] (-date-now this)) 105 | ([this date-now--overloaded-param] (-date-now this date-now--overloaded-param))) 106 | (localDateTime [this temporal] (-local-date-time this temporal)) 107 | (zonedDateTime 108 | ([this temporal] (-zoned-date-time this temporal)) 109 | ([this instant zone] (-zoned-date-time this instant zone))) 110 | (isLeapYear [this proleptic-year] (-is-leap-year this proleptic-year)) 111 | (prolepticYear [this era year-of-era] (-proleptic-year this era year-of-era)) 112 | (eras [this] (-eras this)) 113 | (eraOf [this era-value] (-era-of this era-value)) 114 | (range [this field] (-range this field)) 115 | (resolveDate [this field-values resolver-style] (-resolve-date this field-values resolver-style))) 116 | 117 | 118 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L124 119 | (def JCAL ::JCAL--not-implemented) 120 | 121 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L128 122 | (def LOCALE ::LOCALE--not-implemented) 123 | 124 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseChronology.java#L133 125 | (def INSTANCE ::INSTANCE--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/chrono/iso_chronology.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.iso-chronology 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.abstract-chronology :as AbstractChronology] 5 | [jiffy.chrono.chronology :as Chronology])) 6 | 7 | (defrecord IsoChronology []) 8 | 9 | ;; FIXME: no implementation found from inherited class interface java.lang.Comparable 10 | 11 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L589 12 | (defn -resolve-proleptic-month [this field-values resolver-style] (wip ::-resolve-proleptic-month)) 13 | 14 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L601 15 | (defn -resolve-year-of-era [this field-values resolver-style] (wip ::-resolve-year-of-era)) 16 | 17 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L636 18 | (defn -resolve-ymd [this field-values resolver-style] (wip ::-resolve-ymd)) 19 | 20 | (extend-type IsoChronology 21 | AbstractChronology/IAbstractChronology 22 | (resolveProlepticMonth [this field-values resolver-style] (-resolve-proleptic-month this field-values resolver-style)) 23 | (resolveYearOfEra [this field-values resolver-style] (-resolve-year-of-era this field-values resolver-style)) 24 | (resolveYMD [this field-values resolver-style] (-resolve-ymd this field-values resolver-style))) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L157 27 | (defn -get-id [this] (wip ::-get-id)) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L174 30 | (defn -get-calendar-type [this] (wip ::-get-calendar-type)) 31 | 32 | (defn -date 33 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L267 34 | ([this temporal] (wip ::-date)) 35 | 36 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L209 37 | ([this proleptic-year month day-of-month] (wip ::-date)) 38 | 39 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L192 40 | ([this era year-of-era month day-of-month] (wip ::-date))) 41 | 42 | (defn -date-year-day 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L238 44 | ([this proleptic-year day-of-year] (wip ::-date-year-day)) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L223 47 | ([this era year-of-era day-of-year] (wip ::-date-year-day))) 48 | 49 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L252 50 | (defn -date-epoch-day [this epoch-day] (wip ::-date-epoch-day)) 51 | 52 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L291 53 | (defn -epoch-second [this proleptic-year month day-of-month hour minute second zone-offset] (wip ::-epoch-second)) 54 | 55 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L369 56 | (defn -local-date-time [this temporal] (wip ::-local-date-time)) 57 | 58 | (defn -zoned-date-time 59 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L383 60 | ([this temporal] (wip ::-zoned-date-time)) 61 | 62 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L398 63 | ([this instant zone] (wip ::-zoned-date-time))) 64 | 65 | (defn -date-now 66 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L416 67 | ([this] (wip ::-date-now)) 68 | 69 | ;; NB! This method is overloaded! 70 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L433 71 | ([this date-now--overloaded-param] (wip ::-date-now))) 72 | 73 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L475 74 | (defn -is-leap-year [this proleptic-year] (wip ::-is-leap-year)) 75 | 76 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L480 77 | (defn -proleptic-year [this era year-of-era] (wip ::-proleptic-year)) 78 | 79 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L488 80 | (defn -era-of [this era-value] (wip ::-era-of)) 81 | 82 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L493 83 | (defn -eras [this] (wip ::-eras)) 84 | 85 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L584 86 | (defn -resolve-date [this field-values resolver-style] (wip ::-resolve-date)) 87 | 88 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L658 89 | (defn -range [this field] (wip ::-range)) 90 | 91 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L676 92 | (defn -period [this years months days] (wip ::-period)) 93 | 94 | (extend-type IsoChronology 95 | Chronology/IChronology 96 | (getId [this] (-get-id this)) 97 | (getCalendarType [this] (-get-calendar-type this)) 98 | (date 99 | ([this temporal] (-date this temporal)) 100 | ([this proleptic-year month day-of-month] (-date this proleptic-year month day-of-month)) 101 | ([this era year-of-era month day-of-month] (-date this era year-of-era month day-of-month))) 102 | (dateYearDay 103 | ([this proleptic-year day-of-year] (-date-year-day this proleptic-year day-of-year)) 104 | ([this era year-of-era day-of-year] (-date-year-day this era year-of-era day-of-year))) 105 | (dateEpochDay [this epoch-day] (-date-epoch-day this epoch-day)) 106 | (epochSecond [this proleptic-year month day-of-month hour minute second zone-offset] (-epoch-second this proleptic-year month day-of-month hour minute second zone-offset)) 107 | (localDateTime [this temporal] (-local-date-time this temporal)) 108 | (zonedDateTime 109 | ([this temporal] (-zoned-date-time this temporal)) 110 | ([this instant zone] (-zoned-date-time this instant zone))) 111 | (dateNow 112 | ([this] (-date-now this)) 113 | ([this date-now--overloaded-param] (-date-now this date-now--overloaded-param))) 114 | (isLeapYear [this proleptic-year] (-is-leap-year this proleptic-year)) 115 | (prolepticYear [this era year-of-era] (-proleptic-year this era year-of-era)) 116 | (eraOf [this era-value] (-era-of this era-value)) 117 | (eras [this] (-eras this)) 118 | (resolveDate [this field-values resolver-style] (-resolve-date this field-values resolver-style)) 119 | (range [this field] (-range this field)) 120 | (period [this years months days] (-period this years months days))) 121 | 122 | 123 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/IsoChronology.java#L131 124 | (def INSTANCE ::INSTANCE--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/chrono/minguo_date.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.minguo-date 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.chrono-local-date :as ChronoLocalDate] 5 | [jiffy.chrono.chrono-local-date-impl :as ChronoLocalDateImpl] 6 | [jiffy.temporal.temporal :as Temporal] 7 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 8 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 9 | 10 | (defrecord MinguoDate []) 11 | 12 | ;; FIXME: no implementation found from inherited class interface java.lang.Comparable 13 | 14 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L227 15 | (defn -get-chronology [this] (wip ::-get-chronology)) 16 | 17 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L240 18 | (defn -get-era [this] (wip ::-get-era)) 19 | 20 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L253 21 | (defn -length-of-month [this] (wip ::-length-of-month)) 22 | 23 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L427 24 | (defn -at-time [this local-time] (wip ::-at-time)) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L432 27 | (defn -until [this end-date] (wip ::-until)) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L438 30 | (defn -to-epoch-day [this] (wip ::-to-epoch-day)) 31 | 32 | (extend-type MinguoDate 33 | ChronoLocalDate/IChronoLocalDate 34 | (getChronology [this] (-get-chronology this)) 35 | (getEra [this] (-get-era this)) 36 | (lengthOfMonth [this] (-length-of-month this)) 37 | (atTime [this local-time] (-at-time this local-time)) 38 | (until [this end-date] (-until this end-date)) 39 | (toEpochDay [this] (-to-epoch-day this))) 40 | 41 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L372 42 | (defn -plus-years [this years] (wip ::-plus-years)) 43 | 44 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L377 45 | (defn -plus-months [this months] (wip ::-plus-months)) 46 | 47 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L382 48 | (defn -plus-weeks [this weeks-to-add] (wip ::-plus-weeks)) 49 | 50 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L387 51 | (defn -plus-days [this days] (wip ::-plus-days)) 52 | 53 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L402 54 | (defn -minus-years [this years-to-subtract] (wip ::-minus-years)) 55 | 56 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L407 57 | (defn -minus-months [this months-to-subtract] (wip ::-minus-months)) 58 | 59 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L412 60 | (defn -minus-weeks [this weeks-to-subtract] (wip ::-minus-weeks)) 61 | 62 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L417 63 | (defn -minus-days [this days-to-subtract] (wip ::-minus-days)) 64 | 65 | (extend-type MinguoDate 66 | ChronoLocalDateImpl/IChronoLocalDateImpl 67 | (plusYears [this years] (-plus-years this years)) 68 | (plusMonths [this months] (-plus-months this months)) 69 | (plusWeeks [this weeks-to-add] (-plus-weeks this weeks-to-add)) 70 | (plusDays [this days] (-plus-days this days)) 71 | (minusYears [this years-to-subtract] (-minus-years this years-to-subtract)) 72 | (minusMonths [this months-to-subtract] (-minus-months this months-to-subtract)) 73 | (minusWeeks [this weeks-to-subtract] (-minus-weeks this weeks-to-subtract)) 74 | (minusDays [this days-to-subtract] (-minus-days this days-to-subtract))) 75 | 76 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java 77 | (defn -until [this until--unknown-param-name-1 until--unknown-param-name-2] (wip ::-until)) 78 | 79 | (defn -with 80 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L346 81 | ([this adjuster] (wip ::-with)) 82 | 83 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L311 84 | ([this field new-value] (wip ::-with))) 85 | 86 | (defn -plus 87 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L356 88 | ([this amount] (wip ::-plus)) 89 | 90 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L392 91 | ([this amount-to-add unit] (wip ::-plus))) 92 | 93 | (defn -minus 94 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L366 95 | ([this amount] (wip ::-minus)) 96 | 97 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L397 98 | ([this amount-to-add unit] (wip ::-minus))) 99 | 100 | (extend-type MinguoDate 101 | Temporal/ITemporal 102 | (until [this until--unknown-param-name-1 until--unknown-param-name-2] (-until this until--unknown-param-name-1 until--unknown-param-name-2)) 103 | (with 104 | ([this adjuster] (-with this adjuster)) 105 | ([this field new-value] (-with this field new-value))) 106 | (plus 107 | ([this amount] (-plus this amount)) 108 | ([this amount-to-add unit] (-plus this amount-to-add unit))) 109 | (minus 110 | ([this amount] (-minus this amount)) 111 | ([this amount-to-add unit] (-minus this amount-to-add unit)))) 112 | 113 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L259 114 | (defn -range [this field] (wip ::-range)) 115 | 116 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L282 117 | (defn -get-long [this field] (wip ::-get-long)) 118 | 119 | (extend-type MinguoDate 120 | TemporalAccessor/ITemporalAccessor 121 | (range [this field] (-range this field)) 122 | (getLong [this field] (-get-long this field))) 123 | 124 | ;; FIXME: no implementation found from inherited class interface java.time.temporal.TemporalAdjuster 125 | 126 | (defn now 127 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L132 128 | ([] (wip ::now)) 129 | 130 | ;; NB! This method is overloaded! 131 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L148 132 | ([now--overloaded-param] (wip ::now))) 133 | 134 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L181 135 | (defn of [proleptic-year month day-of-month] (wip ::of)) 136 | 137 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/MinguoDate.java#L202 138 | (defn from [temporal] (wip ::from)) 139 | -------------------------------------------------------------------------------- /src/jiffy/chrono/thai_buddhist_date.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.thai-buddhist-date 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.chrono-local-date :as ChronoLocalDate] 5 | [jiffy.chrono.chrono-local-date-impl :as ChronoLocalDateImpl] 6 | [jiffy.temporal.temporal :as Temporal] 7 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 8 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 9 | 10 | (defrecord ThaiBuddhistDate []) 11 | 12 | ;; FIXME: no implementation found from inherited class interface java.lang.Comparable 13 | 14 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L227 15 | (defn -get-chronology [this] (wip ::-get-chronology)) 16 | 17 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L240 18 | (defn -get-era [this] (wip ::-get-era)) 19 | 20 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L253 21 | (defn -length-of-month [this] (wip ::-length-of-month)) 22 | 23 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L427 24 | (defn -at-time [this local-time] (wip ::-at-time)) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L432 27 | (defn -until [this end-date] (wip ::-until)) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L438 30 | (defn -to-epoch-day [this] (wip ::-to-epoch-day)) 31 | 32 | (extend-type ThaiBuddhistDate 33 | ChronoLocalDate/IChronoLocalDate 34 | (getChronology [this] (-get-chronology this)) 35 | (getEra [this] (-get-era this)) 36 | (lengthOfMonth [this] (-length-of-month this)) 37 | (atTime [this local-time] (-at-time this local-time)) 38 | (until [this end-date] (-until this end-date)) 39 | (toEpochDay [this] (-to-epoch-day this))) 40 | 41 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L372 42 | (defn -plus-years [this years] (wip ::-plus-years)) 43 | 44 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L377 45 | (defn -plus-months [this months] (wip ::-plus-months)) 46 | 47 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L382 48 | (defn -plus-weeks [this weeks-to-add] (wip ::-plus-weeks)) 49 | 50 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L387 51 | (defn -plus-days [this days] (wip ::-plus-days)) 52 | 53 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L402 54 | (defn -minus-years [this years-to-subtract] (wip ::-minus-years)) 55 | 56 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L407 57 | (defn -minus-months [this months-to-subtract] (wip ::-minus-months)) 58 | 59 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L412 60 | (defn -minus-weeks [this weeks-to-subtract] (wip ::-minus-weeks)) 61 | 62 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L417 63 | (defn -minus-days [this days-to-subtract] (wip ::-minus-days)) 64 | 65 | (extend-type ThaiBuddhistDate 66 | ChronoLocalDateImpl/IChronoLocalDateImpl 67 | (plusYears [this years] (-plus-years this years)) 68 | (plusMonths [this months] (-plus-months this months)) 69 | (plusWeeks [this weeks-to-add] (-plus-weeks this weeks-to-add)) 70 | (plusDays [this days] (-plus-days this days)) 71 | (minusYears [this years-to-subtract] (-minus-years this years-to-subtract)) 72 | (minusMonths [this months-to-subtract] (-minus-months this months-to-subtract)) 73 | (minusWeeks [this weeks-to-subtract] (-minus-weeks this weeks-to-subtract)) 74 | (minusDays [this days-to-subtract] (-minus-days this days-to-subtract))) 75 | 76 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java 77 | (defn -until [this until--unknown-param-name-1 until--unknown-param-name-2] (wip ::-until)) 78 | 79 | (defn -with 80 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L346 81 | ([this adjuster] (wip ::-with)) 82 | 83 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L311 84 | ([this field new-value] (wip ::-with))) 85 | 86 | (defn -plus 87 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L356 88 | ([this amount] (wip ::-plus)) 89 | 90 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L392 91 | ([this amount-to-add unit] (wip ::-plus))) 92 | 93 | (defn -minus 94 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L366 95 | ([this amount] (wip ::-minus)) 96 | 97 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L397 98 | ([this amount-to-add unit] (wip ::-minus))) 99 | 100 | (extend-type ThaiBuddhistDate 101 | Temporal/ITemporal 102 | (until [this until--unknown-param-name-1 until--unknown-param-name-2] (-until this until--unknown-param-name-1 until--unknown-param-name-2)) 103 | (with 104 | ([this adjuster] (-with this adjuster)) 105 | ([this field new-value] (-with this field new-value))) 106 | (plus 107 | ([this amount] (-plus this amount)) 108 | ([this amount-to-add unit] (-plus this amount-to-add unit))) 109 | (minus 110 | ([this amount] (-minus this amount)) 111 | ([this amount-to-add unit] (-minus this amount-to-add unit)))) 112 | 113 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L259 114 | (defn -range [this field] (wip ::-range)) 115 | 116 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L282 117 | (defn -get-long [this field] (wip ::-get-long)) 118 | 119 | (extend-type ThaiBuddhistDate 120 | TemporalAccessor/ITemporalAccessor 121 | (range [this field] (-range this field)) 122 | (getLong [this field] (-get-long this field))) 123 | 124 | ;; FIXME: no implementation found from inherited class interface java.time.temporal.TemporalAdjuster 125 | 126 | (defn now 127 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L132 128 | ([] (wip ::now)) 129 | 130 | ;; NB! This method is overloaded! 131 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L148 132 | ([now--overloaded-param] (wip ::now))) 133 | 134 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L181 135 | (defn of [proleptic-year month day-of-month] (wip ::of)) 136 | 137 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/ThaiBuddhistDate.java#L202 138 | (defn from [temporal] (wip ::from)) 139 | -------------------------------------------------------------------------------- /src/jiffy/period.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.period 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.chrono.chrono-period :as ChronoPeriod] 4 | [jiffy.temporal.temporal-amount :as TemporalAmount])) 5 | 6 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java 7 | (defprotocol IPeriod 8 | (getYears [this]) 9 | (getMonths [this]) 10 | (getDays [this]) 11 | (withYears [this years]) 12 | (withMonths [this months]) 13 | (withDays [this days]) 14 | (plusYears [this years-to-add]) 15 | (plusMonths [this months-to-add]) 16 | (plusDays [this days-to-add]) 17 | (minusYears [this years-to-subtract]) 18 | (minusMonths [this months-to-subtract]) 19 | (minusDays [this days-to-subtract]) 20 | (toTotalMonths [this])) 21 | 22 | (defrecord Period []) 23 | 24 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L435 25 | (defn -get-years [this] (wip ::-get-years)) 26 | 27 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L437 28 | (defn -get-months [this] (wip ::-get-months)) 29 | 30 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L439 31 | (defn -get-days [this] (wip ::-get-days)) 32 | 33 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L558 34 | (defn -with-years [this years] (wip ::-with-years)) 35 | 36 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L580 37 | (defn -with-months [this months] (wip ::-with-months)) 38 | 39 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L598 40 | (defn -with-days [this days] (wip ::-with-days)) 41 | 42 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L647 43 | (defn -plus-years [this years-to-add] (wip ::-plus-years)) 44 | 45 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L667 46 | (defn -plus-months [this months-to-add] (wip ::-plus-months)) 47 | 48 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L687 49 | (defn -plus-days [this days-to-add] (wip ::-plus-days)) 50 | 51 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L736 52 | (defn -minus-years [this years-to-subtract] (wip ::-minus-years)) 53 | 54 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L753 55 | (defn -minus-months [this months-to-subtract] (wip ::-minus-months)) 56 | 57 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L770 58 | (defn -minus-days [this days-to-subtract] (wip ::-minus-days)) 59 | 60 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L835 61 | (defn -to-total-months [this] (wip ::-to-total-months)) 62 | 63 | (extend-type Period 64 | IPeriod 65 | (getYears [this] (-get-years this)) 66 | (getMonths [this] (-get-months this)) 67 | (getDays [this] (-get-days this)) 68 | (withYears [this years] (-with-years this years)) 69 | (withMonths [this months] (-with-months this months)) 70 | (withDays [this days] (-with-days this days)) 71 | (plusYears [this years-to-add] (-plus-years this years-to-add)) 72 | (plusMonths [this months-to-add] (-plus-months this months-to-add)) 73 | (plusDays [this days-to-add] (-plus-days this days-to-add)) 74 | (minusYears [this years-to-subtract] (-minus-years this years-to-subtract)) 75 | (minusMonths [this months-to-subtract] (-minus-months this months-to-subtract)) 76 | (minusDays [this days-to-subtract] (-minus-days this days-to-subtract)) 77 | (toTotalMonths [this] (-to-total-months this))) 78 | 79 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L473 80 | (defn -get-chronology [this] (wip ::-get-chronology)) 81 | 82 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L485 83 | (defn -is-zero [this] (wip ::-is-zero)) 84 | 85 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L496 86 | (defn -is-negative [this] (wip ::-is-negative)) 87 | 88 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L626 89 | (defn -plus [this amount-to-add] (wip ::-plus)) 90 | 91 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L715 92 | (defn -minus [this amount-to-subtract] (wip ::-minus)) 93 | 94 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L789 95 | (defn -multiplied-by [this scalar] (wip ::-multiplied-by)) 96 | 97 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L812 98 | (defn -negated [this] (wip ::-negated)) 99 | 100 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L834 101 | (defn -normalized [this] (wip ::-normalized)) 102 | 103 | (extend-type Period 104 | ChronoPeriod/IChronoPeriod 105 | (getChronology [this] (-get-chronology this)) 106 | (isZero [this] (-is-zero this)) 107 | (isNegative [this] (-is-negative this)) 108 | (plus [this amount-to-add] (-plus this amount-to-add)) 109 | (minus [this amount-to-subtract] (-minus this amount-to-subtract)) 110 | (multipliedBy [this scalar] (-multiplied-by this scalar)) 111 | (negated [this] (-negated this)) 112 | (normalized [this] (-normalized this))) 113 | 114 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L433 115 | (defn -get [this unit] (wip ::-get)) 116 | 117 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L458 118 | (defn -get-units [this] (wip ::-get-units)) 119 | 120 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L894 121 | (defn -add-to [this temporal] (wip ::-add-to)) 122 | 123 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L947 124 | (defn -subtract-from [this temporal] (wip ::-subtract-from)) 125 | 126 | (extend-type Period 127 | TemporalAmount/ITemporalAmount 128 | (get [this unit] (-get this unit)) 129 | (getUnits [this] (-get-units this)) 130 | (addTo [this temporal] (-add-to this temporal)) 131 | (subtractFrom [this temporal] (-subtract-from this temporal))) 132 | 133 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L178 134 | (defn ofYears [years] (wip ::ofYears)) 135 | 136 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L191 137 | (defn ofMonths [months] (wip ::ofMonths)) 138 | 139 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L205 140 | (defn ofWeeks [weeks] (wip ::ofWeeks)) 141 | 142 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L218 143 | (defn ofDays [days] (wip ::ofDays)) 144 | 145 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L233 146 | (defn of [years months days] (wip ::of)) 147 | 148 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L257 149 | (defn from [amount] (wip ::from)) 150 | 151 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L325 152 | (defn parse [text] (wip ::parse)) 153 | 154 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L386 155 | (defn between [start-date-inclusive end-date-exclusive] (wip ::between)) 156 | 157 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Period.java#L139 158 | (def ZERO ::ZERO--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/chrono/japanese_date.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.chrono.japanese-date 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.time-comparable :as TimeComparable] 4 | [jiffy.chrono.chrono-local-date :as ChronoLocalDate] 5 | [jiffy.chrono.chrono-local-date-impl :as ChronoLocalDateImpl] 6 | [jiffy.temporal.temporal :as Temporal] 7 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 8 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster])) 9 | 10 | (defrecord JapaneseDate []) 11 | 12 | ;; FIXME: no implementation found from inherited class interface java.lang.Comparable 13 | 14 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L366 15 | (defn -get-chronology [this] (wip ::-get-chronology)) 16 | 17 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L378 18 | (defn -get-era [this] (wip ::-get-era)) 19 | 20 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L391 21 | (defn -length-of-month [this] (wip ::-length-of-month)) 22 | 23 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L396 24 | (defn -length-of-year [this] (wip ::-length-of-year)) 25 | 26 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L665 27 | (defn -at-time [this local-time] (wip ::-at-time)) 28 | 29 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L670 30 | (defn -until [this end-date] (wip ::-until)) 31 | 32 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L676 33 | (defn -to-epoch-day [this] (wip ::-to-epoch-day)) 34 | 35 | (extend-type JapaneseDate 36 | ChronoLocalDate/IChronoLocalDate 37 | (getChronology [this] (-get-chronology this)) 38 | (getEra [this] (-get-era this)) 39 | (lengthOfMonth [this] (-length-of-month this)) 40 | (lengthOfYear [this] (-length-of-year this)) 41 | (atTime [this local-time] (-at-time this local-time)) 42 | (until [this end-date] (-until this end-date)) 43 | (toEpochDay [this] (-to-epoch-day this))) 44 | 45 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L610 46 | (defn -plus-years [this years] (wip ::-plus-years)) 47 | 48 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L615 49 | (defn -plus-months [this months] (wip ::-plus-months)) 50 | 51 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L620 52 | (defn -plus-weeks [this weeks-to-add] (wip ::-plus-weeks)) 53 | 54 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L625 55 | (defn -plus-days [this days] (wip ::-plus-days)) 56 | 57 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L640 58 | (defn -minus-years [this years-to-subtract] (wip ::-minus-years)) 59 | 60 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L645 61 | (defn -minus-months [this months-to-subtract] (wip ::-minus-months)) 62 | 63 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L650 64 | (defn -minus-weeks [this weeks-to-subtract] (wip ::-minus-weeks)) 65 | 66 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L655 67 | (defn -minus-days [this days-to-subtract] (wip ::-minus-days)) 68 | 69 | (extend-type JapaneseDate 70 | ChronoLocalDateImpl/IChronoLocalDateImpl 71 | (plusYears [this years] (-plus-years this years)) 72 | (plusMonths [this months] (-plus-months this months)) 73 | (plusWeeks [this weeks-to-add] (-plus-weeks this weeks-to-add)) 74 | (plusDays [this days] (-plus-days this days)) 75 | (minusYears [this years-to-subtract] (-minus-years this years-to-subtract)) 76 | (minusMonths [this months-to-subtract] (-minus-months this months-to-subtract)) 77 | (minusWeeks [this weeks-to-subtract] (-minus-weeks this weeks-to-subtract)) 78 | (minusDays [this days-to-subtract] (-minus-days this days-to-subtract))) 79 | 80 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java 81 | (defn -until [this until--unknown-param-name-1 until--unknown-param-name-2] (wip ::-until)) 82 | 83 | (defn -with 84 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L548 85 | ([this adjuster] (wip ::-with)) 86 | 87 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L514 88 | ([this field new-value] (wip ::-with))) 89 | 90 | (defn -minus 91 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L568 92 | ([this amount] (wip ::-minus)) 93 | 94 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L635 95 | ([this amount-to-add unit] (wip ::-minus))) 96 | 97 | (defn -plus 98 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L558 99 | ([this amount] (wip ::-plus)) 100 | 101 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L630 102 | ([this amount-to-add unit] (wip ::-plus))) 103 | 104 | (extend-type JapaneseDate 105 | Temporal/ITemporal 106 | (until [this until--unknown-param-name-1 until--unknown-param-name-2] (-until this until--unknown-param-name-1 until--unknown-param-name-2)) 107 | (with 108 | ([this adjuster] (-with this adjuster)) 109 | ([this field new-value] (-with this field new-value))) 110 | (minus 111 | ([this amount] (-minus this amount)) 112 | ([this amount-to-add unit] (-minus this amount-to-add unit))) 113 | (plus 114 | ([this amount] (-plus this amount)) 115 | ([this amount-to-add unit] (-plus this amount-to-add unit)))) 116 | 117 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L435 118 | (defn -is-supported [this field] (wip ::-is-supported)) 119 | 120 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L444 121 | (defn -range [this field] (wip ::-range)) 122 | 123 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L466 124 | (defn -get-long [this field] (wip ::-get-long)) 125 | 126 | (extend-type JapaneseDate 127 | TemporalAccessor/ITemporalAccessor 128 | (isSupported [this field] (-is-supported this field)) 129 | (range [this field] (-range this field)) 130 | (getLong [this field] (-get-long this field))) 131 | 132 | ;; FIXME: no implementation found from inherited class interface java.time.temporal.TemporalAdjuster 133 | 134 | (defn now 135 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L165 136 | ([] (wip ::now)) 137 | 138 | ;; NB! This method is overloaded! 139 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L181 140 | ([now--overloaded-param] (wip ::now))) 141 | 142 | (defn of 143 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L254 144 | ([proleptic-year month day-of-month] (wip ::of)) 145 | 146 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L226 147 | ([era year-of-era month day-of-month] (wip ::of))) 148 | 149 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L283 150 | (defn ofYearDay [era year-of-era day-of-year] (wip ::ofYearDay)) 151 | 152 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L319 153 | (defn from [temporal] (wip ::from)) 154 | 155 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/chrono/JapaneseDate.java#L151 156 | (def MEIJI_6_ISODATE ::MEIJI_6_ISODATE--not-implemented) -------------------------------------------------------------------------------- /src/jiffy/year.cljs: -------------------------------------------------------------------------------- 1 | (ns jiffy.year 2 | (:require [jiffy.dev.wip :refer [wip]] 3 | [jiffy.temporal.temporal-accessor :as TemporalAccessor] 4 | [jiffy.temporal.temporal-adjuster :as TemporalAdjuster] 5 | [jiffy.temporal.temporal :as Temporal] 6 | [jiffy.time-comparable :as TimeComparable])) 7 | 8 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java 9 | (defprotocol IYear 10 | (getValue [this]) 11 | (isLeap [this]) 12 | (isValidMonthDay [this month-day]) 13 | (length [this]) 14 | (plusYears [this years-to-add]) 15 | (minusYears [this years-to-subtract]) 16 | (format [this formatter]) 17 | (atDay [this day-of-year]) 18 | (atMonth [this at-month--overloaded-param]) 19 | (atMonthDay [this month-day]) 20 | (isAfter [this other]) 21 | (isBefore [this other])) 22 | 23 | (defrecord Year []) 24 | 25 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L337 26 | (defn -get-value [this] (wip ::-get-value)) 27 | 28 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L527 29 | (defn -is-leap [this] (wip ::-is-leap)) 30 | 31 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L540 32 | (defn -is-valid-month-day [this month-day] (wip ::-is-valid-month-day)) 33 | 34 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L549 35 | (defn -length [this] (wip ::-length)) 36 | 37 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L731 38 | (defn -plus-years [this years-to-add] (wip ::-plus-years)) 39 | 40 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L797 41 | (defn -minus-years [this years-to-subtract] (wip ::-minus-years)) 42 | 43 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L938 44 | (defn -format [this formatter] (wip ::-format)) 45 | 46 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L956 47 | (defn -at-day [this day-of-year] (wip ::-at-day)) 48 | 49 | ;; NB! This method is overloaded! 50 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L974 51 | (defn -at-month [this at-month--overloaded-param] (wip ::-at-month)) 52 | 53 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L1008 54 | (defn -at-month-day [this month-day] (wip ::-at-month-day)) 55 | 56 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L1033 57 | (defn -is-after [this other] (wip ::-is-after)) 58 | 59 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L1043 60 | (defn -is-before [this other] (wip ::-is-before)) 61 | 62 | (extend-type Year 63 | IYear 64 | (getValue [this] (-get-value this)) 65 | (isLeap [this] (-is-leap this)) 66 | (isValidMonthDay [this month-day] (-is-valid-month-day this month-day)) 67 | (length [this] (-length this)) 68 | (plusYears [this years-to-add] (-plus-years this years-to-add)) 69 | (minusYears [this years-to-subtract] (-minus-years this years-to-subtract)) 70 | (format [this formatter] (-format this formatter)) 71 | (atDay [this day-of-year] (-at-day this day-of-year)) 72 | (atMonth [this at-month--overloaded-param] (-at-month this at-month--overloaded-param)) 73 | (atMonthDay [this month-day] (-at-month-day this month-day)) 74 | (isAfter [this other] (-is-after this other)) 75 | (isBefore [this other] (-is-before this other))) 76 | 77 | ;; NB! This method is overloaded! 78 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L1023 79 | (defn -compare-to [this compare-to--overloaded-param] (wip ::-compare-to)) 80 | 81 | (extend-type Year 82 | TimeComparable/ITimeComparable 83 | (compareTo [this compare-to--overloaded-param] (-compare-to this compare-to--overloaded-param))) 84 | 85 | (defn -with 86 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L573 87 | ([this adjuster] (wip ::-with)) 88 | 89 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L619 90 | ([this field new-value] (wip ::-with))) 91 | 92 | (defn -plus 93 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L655 94 | ([this amount-to-add] (wip ::-plus)) 95 | 96 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L708 97 | ([this amount-to-add unit] (wip ::-plus))) 98 | 99 | (defn -minus 100 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L760 101 | ([this amount-to-subtract] (wip ::-minus)) 102 | 103 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L784 104 | ([this amount-to-subtract unit] (wip ::-minus))) 105 | 106 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L913 107 | (defn -until [this end-exclusive unit] (wip ::-until)) 108 | 109 | (extend-type Year 110 | Temporal/ITemporal 111 | (with 112 | ([this adjuster] (-with this adjuster)) 113 | ([this field new-value] (-with this field new-value))) 114 | (plus 115 | ([this amount-to-add] (-plus this amount-to-add)) 116 | ([this amount-to-add unit] (-plus this amount-to-add unit))) 117 | (minus 118 | ([this amount-to-subtract] (-minus this amount-to-subtract)) 119 | ([this amount-to-subtract unit] (-minus this amount-to-subtract unit))) 120 | (until [this end-exclusive unit] (-until this end-exclusive unit))) 121 | 122 | ;; NB! This method is overloaded! 123 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L368 124 | (defn -is-supported [this is-supported--overloaded-param] (wip ::-is-supported)) 125 | 126 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L434 127 | (defn -range [this field] (wip ::-range)) 128 | 129 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L468 130 | (defn -get [this field] (wip ::-get)) 131 | 132 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L496 133 | (defn -get-long [this field] (wip ::-get-long)) 134 | 135 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L822 136 | (defn -query [this query] (wip ::-query)) 137 | 138 | (extend-type Year 139 | TemporalAccessor/ITemporalAccessor 140 | (isSupported [this is-supported--overloaded-param] (-is-supported this is-supported--overloaded-param)) 141 | (range [this field] (-range this field)) 142 | (get [this field] (-get this field)) 143 | (getLong [this field] (-get-long this field)) 144 | (query [this query] (-query this query))) 145 | 146 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L858 147 | (defn -adjust-into [this temporal] (wip ::-adjust-into)) 148 | 149 | (extend-type Year 150 | TemporalAdjuster/ITemporalAdjuster 151 | (adjustInto [this temporal] (-adjust-into this temporal))) 152 | 153 | (defn now 154 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L175 155 | ([] (wip ::now)) 156 | 157 | ;; NB! This method is overloaded! 158 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L191 159 | ([now--overloaded-param] (wip ::now))) 160 | 161 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L225 162 | (defn of [iso-year] (wip ::of)) 163 | 164 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L249 165 | (defn from [temporal] (wip ::from)) 166 | 167 | (defn parse 168 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L276 169 | ([text] (wip ::parse)) 170 | 171 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L290 172 | ([text formatter] (wip ::parse))) 173 | 174 | ;; https://github.com/unofficial-openjdk/openjdk/tree/cec6bec2602578530214b2ce2845a863da563c3d/src/java.base/share/classes/java/time/Year.java#L315 175 | (defn isLeap [year] (wip ::isLeap)) 176 | 177 | (def MIN_VALUE -999999999) 178 | (def MAX_VALUE 999999999) 179 | --------------------------------------------------------------------------------