- Shortened `applyDateFormats` to use `preg_replace_callback`. - The new `render` function returns an empty string if it finds an invalid date format (this replicates an error in the original `render` function).