formatic 0.4.2 → 0.4.3
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/CHANGELOG.md +6 -0
- data/app/components/formatic/date.rb +2 -1
- data/lib/formatic/templates/date.rb +9 -7
- data/lib/formatic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 142e8c45bd25c9b20ec5287736872e8974af37ae08fff7b202dbe7968c07cd08
|
|
4
|
+
data.tar.gz: 221b88ebd0b0b08e73afcec6fb061dfa69267556ffa7d4ad383b76beea528edd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8164cb6a8d6f0effb577340530e0c3d52331417cd8e63395a1a9593dd1fd09be1fa936a41898ab4d57b8119e8f7e6e37d630e0093cc87c7868f1e82285a03d02
|
|
7
|
+
data.tar.gz: 33be02040dcb62fc98e62d6c4f94ad923d7b7a661f92656900f7fc58d81e27b8552c492d37c6eab36ae03c0da43b479ed4d182b5b3138656a1ea3f4a587e7b8b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [0.4.3] 2026-09-17
|
|
2
|
+
|
|
3
|
+
- Add `skip_past` option to `Formatic::Date` to start calendar at today instead of 5 days ago
|
|
4
|
+
- Hide clear (X) calendar flick when the attribute is mandatory
|
|
5
|
+
- Fix `calendar` start date to be relative to `now` param
|
|
6
|
+
|
|
1
7
|
## [0.4.2] 2026-09-14
|
|
2
8
|
|
|
3
9
|
- Even more clearly mark today
|
|
@@ -6,6 +6,7 @@ module Formatic
|
|
|
6
6
|
# Date/calendar
|
|
7
7
|
class Date < ::Formatic::Base
|
|
8
8
|
option :calendar, as: :show_calendar, default: -> { true }
|
|
9
|
+
option :skip_past, default: -> { false }
|
|
9
10
|
|
|
10
11
|
# Represents one element in the calendar.
|
|
11
12
|
class Day
|
|
@@ -87,7 +88,7 @@ module Formatic
|
|
|
87
88
|
end
|
|
88
89
|
|
|
89
90
|
def calendar(now: ::Time.current)
|
|
90
|
-
from = 5.days
|
|
91
|
+
from = skip_past ? now.to_date : (now.to_date - 5.days)
|
|
91
92
|
till = now.beginning_of_month.advance(months: 2).end_of_month.to_date
|
|
92
93
|
|
|
93
94
|
(from..till).map do |date|
|
|
@@ -43,13 +43,15 @@ module Formatic
|
|
|
43
43
|
</div>
|
|
44
44
|
<% if calendar? %>
|
|
45
45
|
<div class="c-formatic-date__calendar">
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
<% if wrapper.optional? %>
|
|
47
|
+
<a class="c-formatic-date__flick c-formatic-date__clear js-formatic-date__shortcut" href="#"
|
|
48
|
+
data-day=""
|
|
49
|
+
data-month=""
|
|
50
|
+
data-year=""
|
|
51
|
+
>
|
|
52
|
+
X
|
|
53
|
+
</a>
|
|
54
|
+
<% end %>
|
|
53
55
|
<% calendar.each do |day| %>
|
|
54
56
|
<a class="c-formatic-date__flick <%= day.classes %> js-formatic-date__shortcut"
|
|
55
57
|
href='#'
|
data/lib/formatic/version.rb
CHANGED
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.4.
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- halo
|
|
@@ -228,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
228
228
|
- !ruby/object:Gem::Version
|
|
229
229
|
version: '0'
|
|
230
230
|
requirements: []
|
|
231
|
-
rubygems_version:
|
|
231
|
+
rubygems_version: 4.0.6
|
|
232
232
|
specification_version: 4
|
|
233
233
|
summary: A set of ViewComponents for form elements
|
|
234
234
|
test_files: []
|