本文整理汇总了TypeScript中date-fns.isSameDay函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isSameDay函数的具体用法?TypeScript isSameDay怎么用?TypeScript isSameDay使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isSameDay函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: times
times(getDaysInMonth(date), () => {
const day = new Date(monthDate);
if (showWeekend === true || !isWeekend(day)) {
days.push(new CalendarDay(day, false, isSameDay(monthDate, new Date())));
}
monthDate = addDays(monthDate, 1);
});
示例2: getWeekDay
function getWeekDay({ date }: { date: Date }): WeekDay {
const today: Date = dateFns.startOfDay(new Date());
return {
date,
isPast: date < today,
isToday: dateFns.isSameDay(date, today),
isFuture: date > today,
isWeekend: WEEKEND_DAY_NUMBERS.indexOf(dateFns.getDay(date)) > -1,
};
}
示例3: getResponseData
const tomorrowForecast = getResponseData(response).periods.find((period) =>
isSameDay(new Date(period.time.start), addDays(new Date(), 1)),
示例4: isSameDay
export function isSameDay(dateLeft: Date, dateRight: Date): boolean {
return _isSameDay(dateLeft, dateRight);
}