defaulting to now.

This commit is contained in:
Bryce Covert
2018-07-23 13:43:01 -07:00
parent 695cd38227
commit dbb5e8b40c

View File

@@ -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}]]]