Files
klz-cables.com/.pnpm-store/v10/files/2f/a240910009f1e178902bd2fa8a0d4928470e70987a549f07c0272234125d68a035451ca3631bb4ce0b5ebf0269fa2be90444246fb25e0c1b7811174abd2ce5
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
913 B
Plaintext

import { endOfDay } from "./endOfDay.mjs";
import { endOfMonth } from "./endOfMonth.mjs";
import { toDate } from "./toDate.mjs";
/**
* @name isLastDayOfMonth
* @category Month Helpers
* @summary Is the given date the last day of a month?
*
* @description
* Is the given date the last day of a month?
*
* @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 the last day of a month
*
* @example
* // Is 28 February 2014 the last day of a month?
* const result = isLastDayOfMonth(new Date(2014, 1, 28))
* //=> true
*/
export function isLastDayOfMonth(date) {
const _date = toDate(date);
return +endOfDay(_date) === +endOfMonth(_date);
}
// Fallback for modularized imports:
export default isLastDayOfMonth;