i18n_date_range 1.0.1 → 1.0.3

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: f38a2147e122551310ee5d28d3df45ef4dab7f5f29cfe8671e48d11e4a4f9691
4
- data.tar.gz: 62bdeedfe23d3faab4abebeaffafe2848da2747556720c99888e4fea10b3d695
3
+ metadata.gz: d63ea2ee051f21d65183750a064b9cd38f3248a55e50ec037056246c8e7a7424
4
+ data.tar.gz: fac4a2b62b8b2f0d38ba75b5107eed21dd7a0e09bdd0812f190e5f59292cdfe2
5
5
  SHA512:
6
- metadata.gz: f27c07f2d24572906268d24238de7422c727ae1e778107668d92f30b1ae82860f6325b1d6995be45c0177df1601fa7a45ad8c9d88a8b31b48105460e43054671
7
- data.tar.gz: 10f90d2035b0c156fae99d838c81b4a2b4194a2c59e1b7c84248f4953071a0924dba1165d38a65911b79cfb2ec2864f1a2080e6f61732812b6f93cc80c1cdeeb
6
+ metadata.gz: af9801311b093b741615eb8c9fb2a2a34c3917cfcd88dcc60eab1016b122b61b4bd8ee68c610f64d68d257a0231e155c9974a2f392c52deff3fe93332bbc723c
7
+ data.tar.gz: 32917fd6bf796a4333492f2cedaca7293a508681b826c51eeb74b564ecdabee95db9ec4b0976c555d7e477f463640ba4201a8cfc7ff21696be06906b6db33f8e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- i18n_date_range (1.0.1)
4
+ i18n_date_range (1.0.3)
5
5
  rails
6
6
  rails-i18n
7
7
 
@@ -4,11 +4,7 @@
4
4
  class I18nDateRangeGenerator
5
5
  attr_reader :from_date, :to_date, :format, :layout
6
6
 
7
- def self.generate(from_date, to_date, format: :short, layout: :one_line)
8
- new(from_date, to_date, format: format, layout: layout).to_s
9
- end
10
-
11
- def initialize(from_date, to_date, format: :short, layout: :one_line)
7
+ def initialize(from_date, to_date = nil, format: :short, layout: :one_line)
12
8
  @from_date = from_date
13
9
  @to_date = to_date
14
10
  @format = format
@@ -2,12 +2,12 @@
2
2
 
3
3
  # Rails helper
4
4
  # Format can be :short (default) or :long
5
- # <%= date_range_i18n(start, end, :long)
5
+ # <%= date_range_i18n(start, end, format: :long) %>
6
6
  # Layout can be :one_line (default) or :two_lines, other might be necessary in the future
7
7
  module I18nDateRangeHelper
8
8
 
9
- def date_range_i18n(from, to = nil, format: nil, layout: nil)
10
- I18nDateRangeGenerator.generate(from, to, format: format, layout: layout)
9
+ def date_range_i18n(from_date, to_date = nil, format: :short, layout: :one_line)
10
+ I18nDateRangeGenerator.new(from_date, to_date, format: format, layout: layout).to_s.html_safe
11
11
  end
12
12
 
13
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module I18nDateRange
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_date_range
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - pabois