calendar_date_select 1.13 → 1.14
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/History.txt +4 -1
- data/lib/calendar_date_select.rb +1 -1
- data/lib/calendar_date_select/calendar_date_select.rb +1 -1
- data/lib/calendar_date_select/form_helpers.rb +2 -1
- data/lib/calendar_date_select/includes_helper.rb +3 -3
- data/public/javascripts/calendar_date_select/calendar_date_select.js +1 -1
- data/public/javascripts/calendar_date_select/format_hyphen_ampm.js +5 -4
- data/spec/calendar_date_select/form_helpers_spec.rb +5 -0
- metadata +2 -2
data/History.txt
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
|
1
|
+
== Version 1.14
|
2
|
+
* Added support for Rails 2.3
|
3
|
+
|
4
|
+
== Version 1.13
|
2
5
|
* Lots of code clean up!
|
3
6
|
* Moved test suite over to rspec
|
4
7
|
* CalendarDateSelect.default_options implemented. Use CalendarDateSelect.default_options.update(...) to set the default_options for your app.
|
data/lib/calendar_date_select.rb
CHANGED
@@ -2,7 +2,7 @@ require "calendar_date_select/calendar_date_select.rb"
|
|
2
2
|
require "calendar_date_select/form_helpers.rb"
|
3
3
|
require "calendar_date_select/includes_helper.rb"
|
4
4
|
|
5
|
-
if Object.const_defined?(:Rails) && File.directory?(Rails.root + "/public")
|
5
|
+
if Object.const_defined?(:Rails) && File.directory?(Rails.root.to_s + "/public")
|
6
6
|
ActionView::Helpers::FormHelper.send(:include, CalendarDateSelect::FormHelpers)
|
7
7
|
ActionView::Base.send(:include, CalendarDateSelect::FormHelpers)
|
8
8
|
ActionView::Base.send(:include, CalendarDateSelect::IncludesHelper)
|
@@ -198,7 +198,8 @@ module CalendarDateSelect::FormHelpers
|
|
198
198
|
out << " "
|
199
199
|
out << image_tag(options[:image],
|
200
200
|
:onclick => "new CalendarDateSelect( $(this).previous(), #{options_for_javascript(javascript_options)} );",
|
201
|
-
:style => 'border:0px; cursor:pointer;'
|
201
|
+
:style => 'border:0px; cursor:pointer;',
|
202
|
+
:class=>'calendar_date_select_popup_icon')
|
202
203
|
end
|
203
204
|
out
|
204
205
|
end
|
@@ -7,7 +7,7 @@ module CalendarDateSelect::IncludesHelper
|
|
7
7
|
|
8
8
|
# returns an array of javascripts needed for the selected locale, date_format, and calendar control itself.
|
9
9
|
def calendar_date_select_javascripts(options = {})
|
10
|
-
options.assert_valid_keys(:
|
10
|
+
options.assert_valid_keys(:locale)
|
11
11
|
files = ["calendar_date_select/calendar_date_select"]
|
12
12
|
files << "calendar_date_select/locale/#{options[:locale]}" if options[:locale]
|
13
13
|
files << "calendar_date_select/#{CalendarDateSelect.format[:javascript_include]}" if CalendarDateSelect.format[:javascript_include]
|
@@ -20,10 +20,10 @@ module CalendarDateSelect::IncludesHelper
|
|
20
20
|
@cds_already_included=true
|
21
21
|
|
22
22
|
options = (Hash === args.last) ? args.pop : {}
|
23
|
-
options.assert_valid_keys(:style, :
|
23
|
+
options.assert_valid_keys(:style, :locale)
|
24
24
|
options[:style] ||= args.shift
|
25
25
|
|
26
|
-
javascript_include_tag(*calendar_date_select_javascripts(:locale => options[:locale]
|
26
|
+
javascript_include_tag(*calendar_date_select_javascripts(:locale => options[:locale])) + "\n" +
|
27
27
|
stylesheet_link_tag(*calendar_date_select_stylesheets(:style => options[:style])) + "\n"
|
28
28
|
end
|
29
29
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// CalendarDateSelect version 1.
|
1
|
+
// CalendarDateSelect version 1.14 - a prototype based date picker
|
2
2
|
// Questions, comments, bugs? - see the project page: http://code.google.com/p/calendardateselect
|
3
3
|
if (typeof Prototype == 'undefined') alert("CalendarDateSelect Error: Prototype could not be found. Please make sure that your application's layout includes prototype.js (.g. <%= javascript_include_tag :defaults %>) *before* it includes calendar_date_select.js (.g. <%= calendar_date_select_includes %>).");
|
4
4
|
if (Prototype.Version < "1.6") alert("Prototype 1.6.0 is required. If using earlier version of prototype, please use calendar_date_select version 1.8.3");
|
@@ -18,11 +18,12 @@ Date.parseFormattedString = function (string) {
|
|
18
18
|
if (d[7]) {
|
19
19
|
hours = parseInt(d[7], 10);
|
20
20
|
offset=0;
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
if (d[9]) {
|
22
|
+
is_pm = (d[9].toLowerCase()=="pm");
|
23
|
+
if (is_pm && hours <= 11) hours+=12;
|
24
|
+
if (!is_pm && hours == 12) hours=0;
|
25
|
+
}
|
24
26
|
date.setHours(hours);
|
25
|
-
|
26
27
|
}
|
27
28
|
if (d[8]) { date.setMinutes(d[8]); }
|
28
29
|
if (d[10]) { date.setSeconds(d[10]); }
|
@@ -124,6 +124,11 @@ describe CalendarDateSelect::FormHelpers do
|
|
124
124
|
output.should_not include("image:")
|
125
125
|
end
|
126
126
|
|
127
|
+
it "should use the CSS class calendar_date_select_tag for popup selector icon" do
|
128
|
+
output = calendar_date_select_tag(:name, "Some String", :image => "boogy.png")
|
129
|
+
output.should include("calendar_date_select_popup_icon")
|
130
|
+
end
|
131
|
+
|
127
132
|
describe "calendar_date_select_tag" do
|
128
133
|
it "should use the string verbatim when provided" do
|
129
134
|
output = calendar_date_select_tag(:name, "Some String")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calendar_date_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "1.
|
4
|
+
version: "1.14"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Harper
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-02-19 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|