@cloudcome/utils-core
Version:
cloudcome core utils
24 lines (23 loc) • 803 B
TypeScript
import { DateValue } from './core';
/**
* 计算指定日期所在月份的天数
* @param dateValue - 可以是数值、字符串或 Date 对象
* @returns 返回指定日期所在月份的天数
* @example
* ```typescript
* dateDaysInMonth(new Date('2023-02-15')); // 28
* dateDaysInMonth(new Date('2024-02-15')); // 29 (闰年)
* ```
*/
export declare function dateDaysInMonth(dateValue: DateValue): number;
/**
* 计算指定日期所在年份的天数
* @param dateValue - 可以是数值、字符串或 Date 对象
* @returns 返回指定日期所在年份的天数
* @example
* ```typescript
* dateDaysInYear(new Date('2023-02-15')); // 365
* dateDaysInYear(new Date('2024-02-15')); // 366 (闰年)
* ```
*/
export declare function dateDaysInYear(dateValue: DateValue): number;