streamlined sparkline JS and added datepicker for events