MinimumFrom 2.1.0, Deprecated 2.7.0
moment().min(Moment|String|Number|Date|Array);
Note: This function has been deprecated in 2.7.0. Consider moment.max
instead.
Limits the moment to a minimum of another moment value. So a.min(b)
is the same as a = moment.max(a, b)
(note that min
is converted to max
).
This is the counterpart for moment#max
.
moment().min("2013-04-20T20:00:00+0800");
This can be used in conjunction with moment#max
to clamp a moment to a range.
var start = moment().startOf('week');
var end = moment().endOf('week');
var actual = moment().min(start).max(end);
当前内容版权归 momentjs.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 momentjs.com .