calendar_date_select 1.13 → 1.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,7 @@
1
- == Version 1.13
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.
@@ -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)
@@ -1,5 +1,5 @@
1
1
  module CalendarDateSelect
2
- VERSION = '1.13'
2
+ VERSION = '1.14'
3
3
  FORMATS = {
4
4
  :natural => {
5
5
  :date => "%B %d, %Y",
@@ -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(:format, :locale)
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, :format, :locale)
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], :format => options[:format])) + "\n" +
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.13 - a prototype based date picker
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
- is_pm = (d[9].toLowerCase()=="pm")
22
- if (is_pm && hours <= 11) hours+=12;
23
- if (!is_pm && hours == 12) hours=0;
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.13"
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: 2008-11-30 00:00:00 -07:00
12
+ date: 2009-02-19 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency