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.
- data/example.html +9 -0
- data/lib/input_calendar/version.rb +1 -1
- data/src/calendar.coffee +3 -1
- data/vendor/assets/javascripts/input_calendar.js +1 -0
- metadata +4 -4
data/example.html
CHANGED
@@ -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>
|
data/src/calendar.coffee
CHANGED
@@ -24,7 +24,9 @@ class @Calendar
|
|
24
24
|
new Calendar(null, field, options)
|
25
25
|
|
26
26
|
getDateFromField: () ->
|
27
|
-
|
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
|
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:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
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-
|
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
|