refactor dateparser and fix bug where some date formats went unrecognised