Implementing date restriction on input parsing