You can use isSame()
, limiting the granularity to a day:
var today = moment(1406019110000);
var yesterday = moment(1405951867000);
if (today.isSame(yesterday, 'd')) {
// They are on the same day
} else {
// They are not on the same day
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…