Commit 126f8dcb0125bb82787175aed81be55162442a5e
- Date: Mon May 12 18:15:18 +0000 2008
- Committer: Tim Harper (timcharper@gmail.com)
- Author: Tim Harper (timcharper@gmail.com)
- Commit SHA1: 126f8dcb0125bb82787175aed81be55162442a5e
- Tree SHA1: d21a7179b25305f8b9388baa0c5b6c38d9f7b33f
if "object" doesn't respond to the method specified, it was throwing an error. Fixed (thanks, Joe Tanner!)
Commit diff
| |   |
| 154 | 154 | use_time = options[:time] |
| 155 | 155 | |
| 156 | 156 | if options[:time].to_s=="mixed" |
| 157 | | use_time = false if Date===obj.send(method) |
| 157 | use_time = false if Date===(obj.respond_to?(method) && obj.send(method)) |
| 158 | 158 | end |
| 159 | 159 | |
| 160 | 160 | calendar_options = calendar_date_select_process_options(options) |
| toggle raw diff |
--- a/lib/calendar_date_select.rb
+++ b/lib/calendar_date_select.rb
@@ -154,7 +154,7 @@ class CalendarDateSelect
use_time = options[:time]
if options[:time].to_s=="mixed"
- use_time = false if Date===obj.send(method)
+ use_time = false if Date===(obj.respond_to?(method) && obj.send(method))
end
calendar_options = calendar_date_select_process_options(options)
|