Files
klz-cables.com/.pnpm-store/v10/files/fd/0c15aed9663d47f9e8945644cd0c43648c66f713c8576bcd26e57e94b32357292f238e73f6cea5ec1c04322d4c5da7beda00d15a5218cd34904ff76cf51ee9
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

31 lines
874 B
Plaintext

import { constructNow } from "./constructNow.mjs";
import { isSameDay } from "./isSameDay.mjs";
import { subDays } from "./subDays.mjs";
/**
* @name isYesterday
* @category Day Helpers
* @summary Is the given date yesterday?
* @pure false
*
* @description
* Is the given date yesterday?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to check
*
* @returns The date is yesterday
*
* @example
* // If today is 6 October 2014, is 5 October 14:00:00 yesterday?
* const result = isYesterday(new Date(2014, 9, 5, 14, 0))
* //=> true
*/
export function isYesterday(date) {
return isSameDay(date, subDays(constructNow(date), 1));
}
// Fallback for modularized imports:
export default isYesterday;