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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fb6984b1bcf7834695c46f425ad5509875e0b229883c660d267fc9c341ec268
4
- data.tar.gz: ef9149dc91f5c04c9529b032f54af58eeaa1dfb006adc52febe7cf5f880f8871
3
+ metadata.gz: cd20b566bfd12f246ccae474d8f30d49f311b0b9a9b049cfa81064838336d1d3
4
+ data.tar.gz: c404e5bae2b92b32a1e1d56f0c6e116ea85c4e41439372ade147dcbdaea1ce25
5
5
  SHA512:
6
- metadata.gz: 10744bf1137b25a36d2a3503b86618ed4116554647bb66616d5f300ec0b0e023a9fd5e7e73d8e92eb0a0587645861170ef29021e77982343821a75c5af5ae74b
7
- data.tar.gz: 532356801b253199ccf7a4e003f80e07926dc83c48555a69d6d1c79ed0984482664b1819b745afb097c6c4a3f4a07931342dd7b7e1c1037912ff0d83b4fa440e
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
- <% unless discard_day %>
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=""
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Formatic
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formatic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - halo