effective_datatables 1.1.4 → 1.1.5

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
  SHA1:
3
- metadata.gz: 071db373deaa1e0e801afc3e6c4ebfdcd8fefd8c
4
- data.tar.gz: 2d1846f8364e25867067c511f2332fc03f6e3c02
3
+ metadata.gz: 039eb94ab3a7903478a9f1bd0042c9904a323c05
4
+ data.tar.gz: b409d5677a63a0bd6e42684288f11fc5fa5173c8
5
5
  SHA512:
6
- metadata.gz: 56154dcdd59a7115f0fe1e667a00745e29bf31d53be51fc7093a134adc74950ed7281391c325f8d2c1b0b0d40afd17172447bece758e61672002fdc9903573e6
7
- data.tar.gz: 057087f1ddf11a03c4c4e3e4c768db53f005d5d56632f4e32dedc6072a4859da3e87f1da32c4225bc5632df8d5ec934a300c07cf2ac94d547713af38fe73a6dd
6
+ metadata.gz: 158e7ea9aae978a0e817e7a259a858e78fd355b9effdcd5f70d9049415abdd1763c7fb9a2dac58368052e54319c02a8effaa399649739c4a34083236ddf1d934
7
+ data.tar.gz: 3c2d39b4d0b5eb7fd8a469f03b3aa287497b0720fef35bed3036076c8680eb40402a3dba11ec150c62a485869bf397e3ae16941048eddb2c47a2dfd55ead48a7
@@ -239,11 +239,11 @@ module Effective
239
239
  # Last minute formatting of dates
240
240
  case value
241
241
  when Date
242
- value.strftime("%Y-%m-%d")
242
+ value.strftime(EffectiveDatatables.date_format)
243
243
  when Time
244
- value.strftime("%Y-%m-%d %H:%M:%S")
244
+ value.strftime(EffectiveDatatables.datetime_format)
245
245
  when DateTime
246
- value.strftime("%Y-%m-%d %H:%M:%S")
246
+ value.strftime(EffectiveDatatables.datetime_format)
247
247
  else
248
248
  value
249
249
  end
@@ -6,6 +6,8 @@ require "effective_datatables/version"
6
6
 
7
7
  module EffectiveDatatables
8
8
  mattr_accessor :authorization_method
9
+ mattr_accessor :date_format
10
+ mattr_accessor :datetime_format
9
11
 
10
12
  def self.setup
11
13
  yield self
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '1.1.4'.freeze
2
+ VERSION = '1.1.5'.freeze
3
3
  end
@@ -20,4 +20,11 @@ EffectiveDatatables.setup do |config|
20
20
  # config.authorization_method = false
21
21
 
22
22
  config.authorization_method = Proc.new { |controller, action, resource| true } # All users can see every screen
23
+
24
+ # Date & DateTime Format
25
+ # By default, format Date and DateTime values with the following
26
+ config.date_format = "%Y-%m-%d"
27
+ config.datetime_format = "%Y-%m-%d %H:%M"
28
+
29
+
23
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_datatables
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect