If I try to get the min of two moments, one of which is invalid, then the result I get depends on the order in which I specify the moments:
moment.min(moment(""), moment()).toDate()
// Invalid Date
moment.min(moment(), moment("")).toDate()
// Wed May 06 2015 14:52:20 GMT-0500 (CDT)
I'm not sure what the expected behavior should be, but what I expected is something like this:
function getMin() {
var dates = Array.prototype.slice.call(arguments);
dates = dates.filter(function (a) {return a.isValid();});
// etc.
}
If I try to get the min of two moments, one of which is invalid, then the result I get depends on the order in which I specify the moments:
I'm not sure what the expected behavior should be, but what I expected is something like this: