Rocky_Mountain_Vending/.pnpm-store/v10/files/02/30859554fe772f7b157695d0d045b95f391a27cdf6869fa614728ded2c9a7a2e99affd9966f78a4f142af2fc6e518892d5a9f3ee978ee1d37ee34b20450bc3
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

40 lines
936 B
Text

import { constructNow } from "./constructNow.js";
/**
* The {@link startOfYesterday} function options.
*/
/**
* @name startOfYesterday
* @category Day Helpers
* @summary Return the start of yesterday.
* @pure false
*
* @typeParam ContextDate - The `Date` type of the context function.
*
* @param options - An object with options
*
* @description
* Return the start of yesterday.
*
* @returns The start of yesterday
*
* @example
* // If today is 6 October 2014:
* const result = startOfYesterday()
* //=> Sun Oct 5 2014 00:00:00
*/
export function startOfYesterday(options) {
const now = constructNow(options?.in);
const year = now.getFullYear();
const month = now.getMonth();
const day = now.getDate();
const date = constructNow(options?.in);
date.setFullYear(year, month, day - 1);
date.setHours(0, 0, 0, 0);
return date;
}
// Fallback for modularized imports:
export default startOfYesterday;