MinMax
MinMax 添加了 .min .max API 以返回 dayjs 来比较给定的 dayjs 实例。它接受多个参数和包含 Day.js 实例的数组。
¥MinMax adds .min .max APIs to return a dayjs to compare given dayjs instances.
This accepts both multiple arguments and array that contains Day.js instance.
var minMax = require("dayjs/plugin/minMax");
// import minMax from 'dayjs/plugin/minMax' // ES 2015
dayjs.extend(minMax);
dayjs.max(dayjs(), dayjs("2018-01-01"), dayjs("2019-01-01"));
dayjs.min([dayjs(), dayjs("2018-01-01"), dayjs("2019-01-01")]);
