Fix JS date handling in charts