Deprecate then eliminate max/min #1548

icambron opened this Issue Mar 25, 2014 · 0 comments


None yet

2 participants


moment().min and moment().max were a good idea for helper functions, but combined with the mutability that most moment() methods have it turned out disasterously confusing.

So we're deprecating those two in favor of moment.min and moment.max, which are non-mutating and work on any number of objects:

// if a, b, c, d are moments ordered in time
moment.min(a, b);  // a
moment.min(a, b, c, d);  // a 
moment.min([a, b, c, d]);  // a
moment.max(a, b);  // b
moment.max(a, b, c, d);  // d
moment.max([a, b, c, d]);  // d
@ichernev ichernev closed this Jun 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment