effective_datatables 4.8.11 → 4.8.12

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: 6a4afdcd4786dac248c61dbebb0b92421ed7651557ae7ec9e7707e8b2a6e71e7
4
- data.tar.gz: 9df56004722f24720d0c5046662084652896eb61b36b967c89e32e25f61bd1ae
3
+ metadata.gz: 9039b9b9cc3e4d4b2f730788b5a82ee4b42f2062bf1ff420f5a0621187c1e536
4
+ data.tar.gz: 548d510b9909c6e7b12dce658e1dd14c173c930294d1684d4471f0750b7f4dc3
5
5
  SHA512:
6
- metadata.gz: e8772639c5f04ced336ea7d7fb9b04873658d509cd32fc0fc19145cd0bff13083d73dbc5e4c9d2e07229ab24fec56adca6437d464f277f61985c6d1956fb0a44
7
- data.tar.gz: 06b2394fb5b1b1ca783cbb096475efbec88d674e3642ca4763610fb705f61420382576f39b5836627e165da8217befc1d1628c1f87c71af760babb0e39701d75
6
+ metadata.gz: 55f2ca52ceda8df0e12f9d9fa1572685d8d11d93a49d665de77adeeb49ccfb2e74c11a85d89c150b14d7fdde13ed84a05c48b53c503f352d2e395da6ae014904
7
+ data.tar.gz: 44ed8ceb32afd06ffbd963d7620ecb848c9c8c3602f6276243498e9af9710a2afba7b4dcd99736d4717c04a1e2bc873143adc70d9c3a33dacc22da144a2ebbe3
@@ -88,9 +88,9 @@ module Effective
88
88
  when :currency
89
89
  view.number_to_currency(value)
90
90
  when :date
91
- (value.strftime('%F') rescue BLANK)
91
+ value.respond_to?(:strftime) ? value.strftime(EffectiveDatatables.format_date) : BLANK
92
92
  when :datetime
93
- (value.strftime('%F %H:%M') rescue BLANK)
93
+ value.respond_to?(:strftime) ? value.strftime(EffectiveDatatables.format_datetime) : BLANK
94
94
  when :decimal
95
95
  value
96
96
  when :duration
@@ -116,7 +116,7 @@ module Effective
116
116
  when Numeric ; view.number_to_currency(value)
117
117
  end
118
118
  when :time
119
- (value.strftime('%H:%M') rescue BLANK)
119
+ value.respond_to?(:strftime) ? value.strftime(EffectiveDatatables.format_time) : BLANK
120
120
  else
121
121
  value.to_s
122
122
  end
@@ -39,4 +39,8 @@ EffectiveDatatables.setup do |config|
39
39
  config.cookie_domain = :all # Should usually be :all
40
40
  config.cookie_tld_length = nil # Leave nil to autodetect, or set to probably 2
41
41
 
42
+ # Date formatting
43
+ config.format_datetime = '%F %H:%M'
44
+ config.format_date = '%F'
45
+ config.format_time = '%H:%M'
42
46
  end
@@ -16,6 +16,10 @@ module EffectiveDatatables
16
16
  mattr_accessor :cookie_domain
17
17
  mattr_accessor :cookie_tld_length
18
18
 
19
+ mattr_accessor :format_datetime
20
+ mattr_accessor :format_date
21
+ mattr_accessor :format_time
22
+
19
23
  mattr_accessor :debug
20
24
 
21
25
  alias_method :max_cookie_size, :cookie_max_size
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '4.8.11'.freeze
2
+ VERSION = '4.8.12'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.8.11
4
+ version: 4.8.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-28 00:00:00.000000000 Z
11
+ date: 2020-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails