i18n_date_range 2.1.0 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 325df9b5fc7d3c4556eabeb1b4c8f689f150eda430633c7578c677d7d924f428
|
4
|
+
data.tar.gz: 8ed8f3b5604b05b0e07cd393c2e20c8df50e1d6622272b49810519f75f2535b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f3843d5cad1e5e07947f6dfee00b210c1d90da605e14fb0b591a01733a26f6888a58a4a663b1f5514910b9696748ee6e687462adee957cefea03cfe899a6a7d
|
7
|
+
data.tar.gz: 160e2ac0804dc4170e1052ecd9b309cfbc3c28e5395868730bfc58f2472a0cff1ff6fe642a414bc8ed56ee4fd9964c4539e777fa9364f9ce6c4d35e50d81307c
|
data/Gemfile.lock
CHANGED
@@ -72,7 +72,7 @@ class I18nDateRangeGenerator
|
|
72
72
|
|
73
73
|
def from_formatted
|
74
74
|
@from_formatted ||= begin
|
75
|
-
from = I18n.l(from_date, format: from_sentence)
|
75
|
+
from = I18n.l(from_date, format: from_sentence, locale: locale)
|
76
76
|
from = from.upcase_first if from_upcase_first
|
77
77
|
from
|
78
78
|
end
|
@@ -81,7 +81,7 @@ class I18nDateRangeGenerator
|
|
81
81
|
def to_formatted
|
82
82
|
return '' if no_end?
|
83
83
|
@to_formatted ||= begin
|
84
|
-
to = I18n.l(to_date, format: to_sentence)
|
84
|
+
to = I18n.l(to_date, format: to_sentence, locale: locale)
|
85
85
|
to = to.upcase_first if to_upcase_first
|
86
86
|
to
|
87
87
|
end
|
@@ -7,7 +7,8 @@
|
|
7
7
|
module I18nDateRangeHelper
|
8
8
|
|
9
9
|
def date_range_i18n(from_date, to_date = nil, **options)
|
10
|
-
|
10
|
+
generator_options = options.slice(:format, :layout, :locale)
|
11
|
+
generator = I18nDateRangeGenerator.new(from_date, to_date, **generator_options)
|
11
12
|
generator.to_s.html_safe
|
12
13
|
end
|
13
14
|
|