fixed cross-browser date handling