formatic 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/components/formatic/date.rb +9 -0
- data/lib/formatic/templates/date.rb +1 -1
- data/lib/formatic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd20b566bfd12f246ccae474d8f30d49f311b0b9a9b049cfa81064838336d1d3
|
4
|
+
data.tar.gz: c404e5bae2b92b32a1e1d56f0c6e116ea85c4e41439372ade147dcbdaea1ce25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c4e6f8ae8a654b46bb918f6b908cbbd594e9da5d933b191b5d94d251e82c493443fa0bc789cdad585e58931d2f1c8b8f5cb2307c6d6b95ddf38b00a838c30ec
|
7
|
+
data.tar.gz: d964411598e580472fc4182af3750a56caa13109223c0b25dab8b53e161bfad685848a5ea40f8fad8ff8d9c9b89c9822de3fa522400464a1055e36aba858833c
|
@@ -5,6 +5,8 @@ require 'formatic/templates/date'
|
|
5
5
|
module Formatic
|
6
6
|
# Date/calendar
|
7
7
|
class Date < ::Formatic::Base
|
8
|
+
option :calendar, as: :show_calendar, default: -> { true }
|
9
|
+
|
8
10
|
# Represents one element in the calendar.
|
9
11
|
class Day
|
10
12
|
extend Dry::Initializer
|
@@ -37,6 +39,13 @@ module Formatic
|
|
37
39
|
%i[c-formatic-date__input]
|
38
40
|
end
|
39
41
|
|
42
|
+
def calendar?
|
43
|
+
return false if show_calendar == false
|
44
|
+
return false if discard_day
|
45
|
+
|
46
|
+
true
|
47
|
+
end
|
48
|
+
|
40
49
|
def options_for_day
|
41
50
|
options_for_select collection_for_day, day_value
|
42
51
|
end
|
@@ -38,7 +38,7 @@ module Formatic
|
|
38
38
|
id: year_input_id,
|
39
39
|
class: 'c-formatic-date__select js-formatic-date__year' %>
|
40
40
|
</div>
|
41
|
-
<%
|
41
|
+
<% if calendar? %>
|
42
42
|
<div class="c-formatic-date__calendar">
|
43
43
|
<a class="c-formatic-date__flick c-formatic-date__clear js-formatic-date__shortcut" href="#"
|
44
44
|
data-day=""
|
data/lib/formatic/version.rb
CHANGED