Fixes #4587 not passing empty string to date()