Получите вчерашнее время DateTime
const today = new Date()
const yesterday = new Date(today)
yesterday.setDate(yesterday.getDate() - 1)
today.toDateString()
yesterday.toDateString()
Confused Chinchilla