moved to new date picker.

This commit is contained in:
2022-07-17 08:28:35 -07:00
parent eba3a5dce3
commit d97d70e08f
14 changed files with 193 additions and 338 deletions

View File

@@ -1,8 +1,6 @@
(ns auto-ap.views.components.date-range-filter
(:require
[clojure.spec.alpha :as s]
[auto-ap.entities.invoice :as invoice]
[auto-ap.views.utils :refer [bind-field date-picker-optional date->str local-now standard]]
[auto-ap.views.utils :refer [bind-field date-picker date->str local-now standard]]
[cljs-time.core :as t]
[re-frame.core :as re-frame]))
@@ -37,9 +35,9 @@
[:div.field.has-addons
[:div.control
[bind-field
[date-picker-optional
[date-picker
{:event on-change-event
:type "date2"
:type "date"
:placeholder "Start"
:class "is-small"
:field [:start]
@@ -47,9 +45,9 @@
:output :text}]]]
[:div.control
[bind-field
[date-picker-optional
[date-picker
{:event on-change-event
:type "date2"
:type "date"
:class "is-small"
:placeholder "End"
:field [:end]

View File

@@ -1,43 +0,0 @@
(ns auto-ap.views.components.number-filter
(:require
[clojure.spec.alpha :as s]
[auto-ap.entities.invoice :as invoice]
[auto-ap.views.components.typeahead :refer [typeahead]]
[auto-ap.views.utils :refer [bind-field date-picker date->str local-now standard]]
[cljs-time.core :as t]
[re-frame.core :as re-frame]))
(defn dispatch-change [on-change-event start end]
(fn [_]
(re-frame/dispatch (into on-change-event [[:start] start]) )
(re-frame/dispatch (into on-change-event [[:end] end]))))
(defn number-filter [{:keys [value on-change-event]}]
[:div
[:div.field.has-addons
[:div.control
[bind-field
[date-picker {:class-name "input is-fullwidth"
:class "input"
:format-week-number (fn [] "")
:previous-month-button-label ""
:placeholder-text "Start"
:next-month-button-label ""
:next-month-label ""
:event on-change-event
:type "date"
:field [:start]
:subscription value}]]]
[:div.control
[bind-field
[date-picker {:class-name "input is-fullwidth"
:class "input"
:format-week-number (fn [] "")
:previous-month-button-label ""
:placeholder-text "End"
:next-month-button-label ""
:event on-change-event
:next-month-label ""
:type "date"
:field [:end]
:subscription value}]]]]])

View File

@@ -1,9 +1,6 @@
(ns auto-ap.views.components.number-filter
(:require
[clojure.spec.alpha :as s]
[auto-ap.entities.invoice :as invoice]
[auto-ap.views.utils :refer [bind-field date-picker date->str local-now standard]]
[cljs-time.core :as t]
[auto-ap.views.utils :refer [bind-field]]
[re-frame.core :as re-frame]))
(defn dispatch-change [on-change-event start end]
@@ -30,5 +27,4 @@
:field [:amount-lte]
:event on-change-event
:step "0.01"
:subscription value}]]]]]]
)
:subscription value}]]]]]])