True that. Either ways first check would just make sure that its a date object, changed it to use <code>d instanceof Date</code>