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

// This is for the datepicker, it pads zeros in front of dates and months smaller than 10
// so 1 becomes 01
function pad(value, length) { 
  length = length || 2; 
  return "0000".substr(0,length - Math.min(String(value).length, length)) + value; 
};

// this is for the datapicker
var today = new Date(),
	tom = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1),
	tomorrow = tom.getFullYear() + "" + pad(tom.getMonth() + 1) + "" + pad(tom.getDate()),
	end_of_year = today.getFullYear() + "1231";