Rocky_Mountain_Vending/.pnpm-store/v10/files/5f/82f239019a8b7f07b6707bb6077af33ab88458f4f23c5e1286d21100ba6e6b678fd4119594d1a52d6b6dd75bc463232f028058dfd64742f74ced2a43e4011f
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

44 lines
1.5 KiB
Text

"use strict";
exports.addDays = addDays;
var _index = require("./constructFrom.cjs");
var _index2 = require("./toDate.cjs");
var _index3 = require("./_core/getDate.cjs");
var _index4 = require("./_core/setDate.cjs");
/**
* The {@link addDays} function options.
*/
/**
* @name addDays
* @category Day Helpers
* @summary Add the specified number of days to the given date.
*
* @description
* Add the specified number of days to the given 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).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of days to be added.
* @param options - An object with options
*
* @returns The new date with the days added
*
* @example
* // Add 10 days to 1 September 2014:
* const result = addDays(new Date(2014, 8, 1), 10)
* //=> Thu Sep 11 2014 00:00:00
*/
function addDays(date, amount, options) {
const _date = (0, _index2.toDate)(date, options?.in);
if (isNaN(amount)) return (0, _index.constructFrom)(options?.in || date, NaN);
// If 0 days, no-op to avoid changing times in the hour before end of DST
if (!amount) return _date;
(0, _index4.setDate)(_date, (0, _index3.getDate)(_date) + amount);
return _date;
}