/******************************************************************** * @author: Kaven * @email: kaven@wuwenkai.com * @website: http://blog.kaven.xyz * @file: [Kaven-Basic] /src/libs/date/Subtract.ts * @create: 2025-06-27 21:46:47.394 * @modify: 2025-07-11 21:19:12.903 * @version: 6.0.0 * @times: 18 * @lines: 116 * @copyright: Copyright © 2018-2025 Kaven. All Rights Reserved. * @description: [description] * @license: * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ********************************************************************/ import { TTimeUnit } from "../type/advanced"; /** * Subtracts a specified amount of time from a given date. * * @param date - The original date from which to subtract. * @param value - The amount to subtract from the date. * @param unit - The unit of time to subtract (e.g., "milliseconds", "seconds", "minutes", etc.). Defaults to "milliseconds". * @returns A new `Date` object with the specified amount of time subtracted. * * @since 4.0.0 * @version 2021-12-14 */ export declare function SubtractDate(date: Date, value: number, unit?: TTimeUnit): Date; /** * Subtracts the specified number of milliseconds from a given date. * * @param date - The original Date object. * @param milliseconds - The number of milliseconds to subtract. * @returns A new Date object with the specified milliseconds subtracted. */ export declare function SubtractMilliseconds(date: Date, milliseconds: number): Date; /** * Subtracts a specified number of seconds from a given date. * * @param date - The original Date object. * @param seconds - The number of seconds to subtract from the date. * @returns A new Date object with the specified number of seconds subtracted. */ export declare function SubtractSeconds(date: Date, seconds: number): Date; /** * Subtracts a specified number of minutes from a given date. * * @param date - The original Date object. * @param minutes - The number of minutes to subtract from the date. * @returns A new Date object with the specified minutes subtracted. */ export declare function SubtractMinutes(date: Date, minutes: number): Date; /** * Subtracts a specified number of hours from a given date. * * @param date - The original Date object from which hours will be subtracted. * @param hours - The number of hours to subtract from the date. * @returns A new Date object with the specified number of hours subtracted. */ export declare function SubtractHours(date: Date, hours: number): Date; /** * Subtracts a specified number of days from a given date. * * @param date - The original date from which days will be subtracted. * @param days - The number of days to subtract from the date. * @returns A new Date object with the specified number of days subtracted. */ export declare function SubtractDays(date: Date, days: number): Date; /** * Subtracts a specified number of weeks from the given date. * * @param date - The original date from which weeks will be subtracted. * @param weeks - The number of weeks to subtract. * @returns A new Date object with the specified number of weeks subtracted. */ export declare function SubtractWeeks(date: Date, weeks: number): Date; //# sourceMappingURL=Subtract.d.ts.map