Skip to content

Home > robinson > isBefore

isBefore() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

判断一个日期是否在另一个日期之前。

Signature:

typescript
declare function isBefore(start: dayjs.ConfigType, end: dayjs.ConfigType): boolean;
declare function isBefore(start: dayjs.ConfigType, end: dayjs.ConfigType): boolean;

Parameters

ParameterTypeDescription
startdayjs.ConfigType开始日期,可以是 dayjs 对象、Date 对象或字符串。
enddayjs.ConfigType结束日期,可以是 dayjs 对象、Date 对象或字符串。

Returns:

boolean

{boolean} - 如果开始日期在结束日期之前返回 true,否则返回 false。

Released under the MIT License.