Improve YYYY-MM and YYYY format for to and from query parameter