diff --git a/lib/calendar/src/quanta/calendar/florian.clj b/lib/calendar/src/quanta/calendar/florian.clj index 77a5978a..678fc723 100644 --- a/lib/calendar/src/quanta/calendar/florian.clj +++ b/lib/calendar/src/quanta/calendar/florian.clj @@ -4,34 +4,47 @@ [ta.calendar.calendars :as caldb] [ta.calendar.helper :as calhelp])) + +(-> (caldb/get-calendar :us) + :timezone + ) +;; => "America/New_York" + + +(-> (caldb/get-calendar :crypto) + :timezone) + +(-> (caldb/get-calendar :crypto) + :timezone) + (defn market-info [market-kw] (let [cal (caldb/get-calendar market-kw) dt (t/instant) - open? (calhelp/time-open? cal dt) - business? (calhelp/day-open? cal dt)] + dt-cal (-> dt + (t/zoned-date-time) + (t/in (:timezone cal))) + open? (calhelp/time-open? cal dt-cal) + business? (calhelp/day-open? cal dt-cal)] {:market market-kw :open? open? :business business? - :as-of-dt dt})) + :as-of-dt dt-cal})) (t/instant) -;; => #time/instant "2024-10-11T21:00:48.086343931Z" - -;; (t/time (t/instant)) -;; => #time/time "16:00:31.179972012" (market-info :crypto) - ;; => {:market :crypto, :open? true, :business true, :as-of-dt #time/instant "2024-10-11T20:57:54.366650110Z"} + ;; => {:market :crypto, :open? true, :business true, :as-of-dt #time/zoned-date-time "2024-10-11T21:10:02.760020057Z[UTC]"} - (market-info :eu) - ;; => {:market :eu, :open? true, :business true, :as-of-dt #time/instant "2024-10-11T20:58:03.620756893Z"} - - - + ;; => {:market :eu, + ;; :open? false, + ;; :business true, + ;; :as-of-dt #time/zoned-date-time "2024-10-11T23:09:51.853464621+02:00[Europe/Berlin]"} (market-info :jp) - ;; => {:market :jp, :open? true, :business true, :as-of-dt #time/instant "2024-10-11T20:58:13.100221665Z"} - + ;; => {:market :jp, + ;; :open? false, + ;; :business false, + ;; :as-of-dt #time/zoned-date-time "2024-10-12T06:09:57.855540184+09:00[Asia/Tokyo]"}