Files
NapCatQQ/.pnpm-store/v3/files/8a/44df6b2f4629da331bf49e8aa78fbcd2c67d7bc6ae68a216c2d2a7c97a80df1844450bc4c7daf9b1c7ccd734600c8a3b02b46ac9396c4a51db94ac1153ff13
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

20 lines
834 B
Plaintext

import { DateInput } from './types';
/**
* Calculates the difference in minutes 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 minutes between the two dates.
* @example
* ```ts
* diffInMinutes(new Date(), new Date()); // 0
* diffInMinutes(new Date(), new Date(Date.now() + 1000 * 60)); // 1
* diffInMinutes(new Date(), new Date(Date.now() - 1000 * 60)); // -1
* diffInMinutes(new Date(), new Date(Date.now() + 1000 * 60 * 60 * 24)); // 1440
* diffInMinutes(new Date(), new Date(Date.now() - 1000 * 60 * 60 * 24)); // -1440
* ```
*/
export default function diffInMinutes(date: Date, input: DateInput, asFloat?: boolean): number;