getDaysInYear.d.ts 739 B

123456789101112131415161718192021222324252627
  1. import type { ContextOptions, DateArg } from "./types.js";
  2. /**
  3. * The {@link getDaysInYear} function options.
  4. */
  5. export interface GetDaysInYearOptions extends ContextOptions<Date> {}
  6. /**
  7. * @name getDaysInYear
  8. * @category Year Helpers
  9. * @summary Get the number of days in a year of the given date.
  10. *
  11. * @description
  12. * Get the number of days in a year of the given date.
  13. *
  14. * @param date - The given date
  15. * @param options - An object with options
  16. *
  17. * @returns The number of days in a year
  18. *
  19. * @example
  20. * // How many days are in 2012?
  21. * const result = getDaysInYear(new Date(2012, 0, 1))
  22. * //=> 366
  23. */
  24. export declare function getDaysInYear(
  25. date: DateArg<Date> & {},
  26. options?: GetDaysInYearOptions | undefined,
  27. ): number;