~pepe/bearimy

4aa549d415c4c6b51e826bf93ce27bac5f5e9d2a — Josef Pospíšil 3 months ago ad8f16d
Revert "Only now could be local time"

This reverts commit ad8f16d6eab287120d87b9d66c48ac6123771eab.
1 files changed, 3 insertions(+), 7 deletions(-)

M bearimy/init.janet
M bearimy/init.janet => bearimy/init.janet +3 -7
@@ 47,19 47,15 @@
        (def {:month m :year y :month-day d :week-day wd
              :minutes u :hours h :seconds s} (os/date (:epoch self)))
        (string/format "%s, %.2i %s %.4i %i:%.2i:%.2i GMT"
                       (get-in week-days [:short wd]) (inc d)
                       (get-in months [:short m]) y h u s))}
                       (get-in week-days [:short wd]) (inc d) (get-in months [:short m]) y h u s))}
    Date))

(defn- table-date [&opt dt]
  (default dt (os/time))
  (merge (os/date dt)))
  (merge (os/date dt (dyn :local-time))))

(defn now []
  (make DateTime
        (table-date
          (os/mktime
            (os/date (os/time) (dyn :local-time))))))
  (make DateTime (table-date)))

(defn today []
  (make Date (merge-into (table-date) midnite)))