207
208
export function fromNowByDay(date: number | Date, appendAgoLabel?: boolean, useFullTimeWords?: boolean): string {
209
>
if (typeof date !== 'number') {
date.ts
210
>
date = date.getTime();
211
>
}
212
>
213
>
const todayMidnightTime = new Date();
214
>
todayMidnightTime.setHours(0, 0, 0, 0);
215
>
const yesterdayMidnightTime = new Date(todayMidnightTime.getTime());
216
>
yesterdayMidnightTime.setDate(yesterdayMidnightTime.getDate() - 1);
217
>
218
>
if (date > todayMidnightTime.getTime()) {
219
return localize('today', 'Today');
220
}