will_pickdate 0.9.1 → 0.9.2

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.
data/README.md CHANGED
@@ -1,4 +1,38 @@
1
- gem_will_pickdate
1
+ Ruby Gem will_pickdate
2
2
  =================
3
3
 
4
- Ruby gem wrapping will_pickdate javascript widget giving support for rails datetime_select to render it instead of the usuall set of select boxes.
4
+ Ruby gem wrapping will_pickdate javascript widget giving support for rails datetime_select to render it instead of the usuall set of select boxes.
5
+
6
+ Usage
7
+ =====
8
+
9
+ On your css (scss):
10
+
11
+ @import "will_pickdate";
12
+
13
+ On your javascript (coffeescript):
14
+
15
+ #= require will_pickdate
16
+
17
+ # somewhere relevant for your app...
18
+ i = document.createElement "input"
19
+ if i.type != 'datetime'
20
+ $('input[type="datetime"]').will_pickdate({})
21
+
22
+ On your views:
23
+
24
+ = form_form @thing do |f| &>
25
+ = f.datetime_field :starts_at %>
26
+
27
+
28
+ Customizing Looks
29
+ =================
30
+
31
+ .wpd {
32
+ ...
33
+ }
34
+
35
+ Customizing other stuff
36
+ =======================
37
+
38
+ Check will_pickdate repo for the javascript opts ;)
@@ -93,6 +93,21 @@
93
93
 
94
94
  this.element.before(this.clone);
95
95
 
96
+ // hook original datetime input for change events, in hope of making it easy for developers to
97
+ // do something in lines of:
98
+ // $('#event_starts_at').change(function(e){ $('#event_ends_at').val(this.value).change() })
99
+ // in order to control through outside behaviours the value and display value of the calendar widget
100
+ this.element.change($.proxy(function(e) {
101
+ this.clone.val(
102
+ this.format(
103
+ new Date(
104
+ this.unformat(
105
+ this.element.val(),
106
+ this.options.inputOutputFormat)
107
+ ),
108
+ this.options.format));
109
+ }, this));
110
+
96
111
  if(this.toggler) {
97
112
  this.toggler.css('cursor', 'pointer').click($.proxy(function(event) {
98
113
  this.onFocus(this.element, this.clone);
@@ -1,3 +1,3 @@
1
1
  module WillPickdate
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: will_pickdate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-21 00:00:00.000000000 Z
12
+ date: 2013-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake