datetime_picker_input 4.17.37 → 4.17.37.1

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
  SHA1:
3
- metadata.gz: 289b0062c14128710d88cb7741a8110f8d6d9887
4
- data.tar.gz: 39e89ce2ac872c41928e2af78d729927f54988b3
3
+ metadata.gz: b9c5531b0f624feeffbea96d8fedcd3364d4acf3
4
+ data.tar.gz: 0e43f64f17e676557a2fb5600a43b2e0a007e942
5
5
  SHA512:
6
- metadata.gz: 0975ae4f17a08cb275a587db967ca8dbf47f195c113c7d290ca76ffd08220b8c97688a7d8429d111551ec2fb5beb7c35969841f20e79582d1eb0e043e066427c
7
- data.tar.gz: dc8f760089ca094ad633ecafe33d366ddf5e0428272fb1a2700dd1560cfb89b6fb816d021a9f831e3dfa8d1864129610303637e681fc1be3fe0891bb313364ca
6
+ metadata.gz: dd512a0aa9ddea9b515a495e6942b437575b786f6b255dacc92541fa5ee36a893c917ee8acccdfdde3e62c0c05c8907a02ebb2f3acae98d2685ae6611e1a5534
7
+ data.tar.gz: 3d1c82769f4da6e2a5a70e7c86d41a0e0bb3be242991fb7daae219726f39b70c23fd0f97c1867a1ac974d3ba90bb52cb20bd578b245d328767b27e0593273c7e
data/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # CHANGELOG
2
+
3
+ ## Unreleased
4
+
5
+ ## 4.17.37.1 - 2015.10.28
6
+
7
+ - Updated generator template to include changes from 4.17.37
8
+
9
+ ## 4.17.37 - 2015.10.28
10
+
11
+ - Updated dependency `bootstrap3-datetimepicker-rails` to v4.17.37
12
+ - Updated dependency `momentjs-rails` to v2.10.6
13
+ - Introduced sane defaults and fixed formatting bug via [PR#13](https://github.com/jollygoodcode/datetime_picker_input/pull/13)
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # DatetimePickerInput
2
2
 
3
- [![Build Status](https://travis-ci.org/jollygoodcode/datetime_picker_input.svg?branch=feature%2Ftravis-ci)](https://travis-ci.org/jollygoodcode/datetime_picker_input)
3
+ [![Gem Version](https://badge.fury.io/rb/datetime_picker_input.svg)](https://badge.fury.io/rb/datetime_picker_input) [![Build Status](https://travis-ci.org/jollygoodcode/datetime_picker_input.svg?branch=feature%2Ftravis-ci)](https://travis-ci.org/jollygoodcode/datetime_picker_input)
4
4
 
5
5
  DatetimePickerInput allows you to easily add a [JavaScript datetime picker](http://eonasdan.github.io/bootstrap-datetimepicker/) to your Ruby on Rails, Bootstrap-enabled Simple Form input.
6
6
 
@@ -63,23 +63,23 @@ then you will need to implement your attribute setter and getter in Rails backen
63
63
  to save and display the value correctly in your desired Time Zone.
64
64
 
65
65
  One way to do this is to implement an `around_filter` on your controllers like so:
66
-
66
+
67
67
  ```ruby
68
68
  class AppointmentsController < ApplicationController
69
69
  around_action :use_current_timezone
70
-
70
+
71
71
  # .. your controller code
72
-
72
+
73
73
  def use_current_timezone(&block)
74
74
  Time.use_zone(current_user.timezone, &block)
75
75
  end
76
- end
76
+ end
77
77
  ```
78
78
 
79
79
  This uses your `user`'s Time Zone, so that the DateTime gets stored and will be displayed as expected (from the user's perspective).
80
80
 
81
- We are also assuming that, in this example, the `current_user` has set a custom Time Zone,
82
- otherwise, you should just use the gem's default.
81
+ We are also assuming that, in this example, the `current_user` has set a custom Time Zone,
82
+ otherwise, you should just use the gem's default.
83
83
 
84
84
  Times are hard..
85
85
 
@@ -1,3 +1,3 @@
1
1
  module DatetimePickerInput
2
- VERSION = "4.17.37"
2
+ VERSION = "4.17.37.1"
3
3
  end
@@ -20,7 +20,10 @@ class DateTimePickerInput < SimpleForm::Inputs::StringInput
20
20
  input_html_options[:data] ||= {}
21
21
  input_html_options[:data].reverse_merge!(date_format: picker_pattern)
22
22
 
23
- input_html_options[:value] ||= I18n.localize(attr_value, format: display_pattern) if attr_value.present?
23
+ input_html_options[:data][:date_extra_formats] ||= []
24
+ input_html_options[:data][:date_extra_formats] << picker_pattern
25
+
26
+ input_html_options[:value] ||= I18n.localize(attr_value.utc, format: display_pattern) if attr_value.present?
24
27
 
25
28
  template.content_tag :div, class: "input-group date datetime_picker" do
26
29
  input = super(wrapper_options)
@@ -39,15 +42,15 @@ class DateTimePickerInput < SimpleForm::Inputs::StringInput
39
42
 
40
43
  private
41
44
 
42
- def display_pattern
43
- "%Y-%m-%d %H:%M:%S %z"
44
- end
45
+ def display_pattern
46
+ "%Y-%m-%d %H:%M:%S %z"
47
+ end
45
48
 
46
- def picker_pattern
47
- "YYYY-MM-DD HH:mm:ss ZZ"
48
- end
49
+ def picker_pattern
50
+ "YYYY-MM-DD HH:mm:ss ZZ"
51
+ end
49
52
 
50
- def attr_value
51
- object.send(attribute_name) if object.respond_to? attribute_name
52
- end
53
+ def attr_value
54
+ object.send(attribute_name) if object.respond_to? attribute_name
55
+ end
53
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datetime_picker_input
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.17.37
4
+ version: 4.17.37.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juanito
@@ -49,6 +49,7 @@ extra_rdoc_files: []
49
49
  files:
50
50
  - ".gitignore"
51
51
  - ".travis.yml"
52
+ - CHANGELOG.md
52
53
  - CONTRIBUTING.md
53
54
  - Gemfile
54
55
  - LICENSE.md
@@ -106,6 +107,7 @@ files:
106
107
  - spec/dummy/config/secrets.yml
107
108
  - spec/dummy/db/migrate/20150224051923_create_appointments.rb
108
109
  - spec/dummy/db/schema.rb
110
+ - spec/dummy/db/test.sqlite3
109
111
  - spec/dummy/lib/assets/.keep
110
112
  - spec/dummy/lib/templates/erb/scaffold/_form.html.erb
111
113
  - spec/dummy/log/.keep
@@ -185,6 +187,7 @@ test_files:
185
187
  - spec/dummy/config.ru
186
188
  - spec/dummy/db/migrate/20150224051923_create_appointments.rb
187
189
  - spec/dummy/db/schema.rb
190
+ - spec/dummy/db/test.sqlite3
188
191
  - spec/dummy/lib/templates/erb/scaffold/_form.html.erb
189
192
  - spec/dummy/log/development.log
190
193
  - spec/dummy/log/test.log