Skip to content

Function: isYesterday() ​

ts
function isYesterday(date): boolean;

Check if the given date is yesterday in local time. 检查日期是否为昨天(本地时间)。

Parameters ​

ParameterType
dateDate

Returns ​

boolean

Example ​

ts
isYesterday(new Date(Date.now() - 86400000)) // => true (approximately)

Since ​

1.0.0

Released under the MIT License.