// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function format_date(value, target) {
	num=[];
	value.gsub('-', ' ').scan(/\w+/, function(match){ num.push(match)});
	// The month in calendar_date_select hasn't 2 digit if < 10
	if(num[1] < 10)
		num[1] = "0"+num[1];
	$(target).update(num[2]+'/'+num[1]+'/'+num[0]);
}