Skip to content

Deprecate then eliminate max/min #1548

@icambron

Description

@icambron

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions