From dbb5e8b40c148cdc919d13fce21b85b30138ba12 Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Mon, 23 Jul 2018 13:43:01 -0700 Subject: [PATCH] defaulting to now. --- src/cljs/auto_ap/views/pages/unpaid_invoices.cljs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs b/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs index 976b6721..7af056ba 100644 --- a/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs +++ b/src/cljs/auto_ap/views/pages/unpaid_invoices.cljs @@ -3,6 +3,7 @@ [reagent.core :as r] [clojure.string :as str] [clojure.spec.alpha :as s] + [cljs-time.core :as c] [goog.string :as gstring] [auto-ap.entities.companies :as company] [auto-ap.entities.invoice :as invoice] @@ -222,7 +223,8 @@ ::new-invoice (fn [{:keys [db]} _] {:dispatch [::events/modal-status ::new-invoice {:visible? true}] - :db (assoc-in db [::new-invoice] {:company-id (:id @(re-frame/subscribe [::subs/company]))})})) + :db (assoc-in db [::new-invoice] {:company-id (:id @(re-frame/subscribe [::subs/company])) + :date (date->str (c/now) standard)})})) (re-frame/reg-event-fx ::create-invoice @@ -271,7 +273,6 @@ :db (-> db (update-in [::invoice-page :invoices] (fn [invoices] - (println invoices-by-id) (map (fn [i] (merge i (invoices-by-id (:id i)))) invoices))) @@ -581,10 +582,10 @@ [bind-field [:input.input {:type "date" - :field [:date] - :event change-event - :spec ::invoice/date - :subscription data}]]] + :field [:date] + :event change-event + :spec ::invoice/date + :subscription data}]]]