Update date.js

ensure null is returned on empty string or undefined