Files
klz-cables.com/.pnpm-store/v10/files/9c/9a2deae6222e2aae382391d183f1133aa624ff6b6dbb3077a8ac710a34908e3ad0a583b92ca8a824ac34a46ff714d85e468dfce21e3be24ea2f3bd9c96e6e4
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

29 lines
1.0 KiB
Plaintext

import { addBusinessDays } from "./addBusinessDays.mjs";
/**
* @name subBusinessDays
* @category Day Helpers
* @summary Substract the specified number of business days (mon - fri) to the given date.
*
* @description
* Substract the specified number of business days (mon - fri) to the given date, ignoring weekends.
*
* @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 be changed
* @param amount - The amount of business days to be subtracted.
*
* @returns The new date with the business days subtracted
*
* @example
* // Substract 10 business days from 1 September 2014:
* const result = subBusinessDays(new Date(2014, 8, 1), 10)
* //=> Mon Aug 18 2014 00:00:00 (skipped weekend days)
*/
export function subBusinessDays(date, amount) {
return addBusinessDays(date, -amount);
}
// Fallback for modularized imports:
export default subBusinessDays;