input_calendar 0.2.3 → 0.2.4

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.
@@ -17,6 +17,15 @@ div { float:left; width:225px;}
17
17
  </style>
18
18
  <body>
19
19
 
20
+ <div>
21
+ <h1>Calendar with empty date</h1>
22
+ <input type="text" value="" id="blank_date" readonly>
23
+ <script>
24
+ Calendar.attach("blank_date")
25
+ </script>
26
+ </div>
27
+
28
+
20
29
  <div>
21
30
  <h1>Default</h1>
22
31
  <input type="text" value="2012-05-21" id="event_date" readonly>
@@ -1,3 +1,3 @@
1
1
  module InputCalendar
2
- VERSION = "0.2.3"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -24,7 +24,9 @@ class @Calendar
24
24
  new Calendar(null, field, options)
25
25
 
26
26
  getDateFromField: () ->
27
- return if @field.val() == ""
27
+ if @field.val() == ""
28
+ @field.val @toDateString(@date)
29
+ return
28
30
  @date = @parseIncomingDate()
29
31
 
30
32
  # should override this in a subclass if you're date string looks different
@@ -38,6 +38,7 @@
38
38
 
39
39
  Calendar.prototype.getDateFromField = function() {
40
40
  if (this.field.val() === "") {
41
+ this.field.val(this.toDateString(this.date));
41
42
  return;
42
43
  }
43
44
  return this.date = this.parseIncomingDate();
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: input_calendar
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Josh Goebel
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-09-04 00:00:00 Z
18
+ date: 2012-09-27 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: Simple and clean JS calendar to enter dates on forms