Bug in format_hs_hash of calendar.rb?

2 views
Skip to first unread message

Tricia

unread,
Aug 13, 2007, 2:12:25 PM8/13/07
to Ruby on Rails: DHTML Calendar
Thanks so much for this plugin! It helps a ton!

However, I think I found a small bug in the format_js_hash method in
calendar.rb. It appears this does not account for the Calendar.setup
params that should be javascript functions. For example, when trying
to call 'onUpdate' you need to pass a javascript function. However,
format_js_hash does not account for this, it instead treats the
function name as a string.

Here is my fix:
def format_js_hash(options)
js_functions = ['flatCallback', 'disableFunc', 'onSelect',
'onClose', 'onUpdate', 'DateStatusFunc']
options = options.collect do |key,value|
unless js_functions.include? key.to_s
key.to_s + ':' + value.inspect
else
key.to_s + ':' + value
end
end
options.join(',')
end

please tell me if I am incorrect with this.

Thanks so much!
Trish

Ed Moss

unread,
Sep 20, 2007, 3:31:19 PM9/20/07
to Ruby on Rails: DHTML Calendar
Fixed in r59.

Thanks!

Reply all
Reply to author
Forward
0 new messages