Fix date filtering and JS