Files
klz-cables.com/.pnpm-store/v10/files/94/b35503a685df037f0bb86697f41a7260612ad7cf80a3861a1c5437d4e83b056c849f0a8b2f3a9e12efda6b58ea9147c14a90bc44ef5790eee2a184ced32e40
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

30 lines
870 B
Plaintext

import { constructNow } from "./constructNow.mjs";
import { isSameYear } from "./isSameYear.mjs";
/**
* @name isThisYear
* @category Year Helpers
* @summary Is the given date in the same year as the current date?
* @pure false
*
* @description
* Is the given date in the same year as the current date?
*
* @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 in this year
*
* @example
* // If today is 25 September 2014, is 2 July 2014 in this year?
* const result = isThisYear(new Date(2014, 6, 2))
* //=> true
*/
export function isThisYear(date) {
return isSameYear(date, constructNow(date));
}
// Fallback for modularized imports:
export default isThisYear;