Added date filter and refactored date formatting