function jam(day) {return day == Date();} var today = new Date(); var tomorrow = new Date(+new Date() + 86400000); var yesterday = new Date(+new Date() - 86400000); var rule = jam(tomorrow) && jam(yesterday) && !jam(today);