Files
SnowLuma/.pnpm-store/v11/files/8d/f9ce5de59d74a075a8cc86bd77c7123eaf9e8cbf4e4289c7be01b0e0f1b85403a97d67f06de6f931fecd87e0f64b57784208d2ccc8e3b037c55caf33588ef2
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

16 lines
636 B
Plaintext

import { DateInput } from './types';
/**
* Calculates the difference in days between two dates.
* 计算两个日期之间的天数差
*
* @param date - The first date to compare. (第一个日期)
* @param input - The second date to compare. (第二个日期)
* @param asFloat - Whether to return the result as a float. (是否返回浮点数)
* @returns The difference in days between the two dates. (返回两个日期之间的天数差)
* @example
* ```ts
* diffInDays(new Date(2023, 0, 1), new Date(2023, 0, 2)) // 1
* ```
*/
export default function diffInDays(date: Date, input: DateInput, asFloat?: boolean): number;