tiny-essentials
Version:
Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.
10 lines • 591 B
text/typescript
/**
* Calculates the age based on the given date.
*
* @param {number|string} timeData - The birth date in a format accepted by moment.js (e.g., Unix timestamp, ISO 8601 string, etc.).
* @param {moment.Moment|null} [now=null] - The moment object representing the current date. Defaults to the current date and time if not provided.
* @returns {number|null} The age in years, or null if `timeData` is not provided.
*/
export default function getAge(timeData?: number | string, now?: moment.Moment | null): number | null;
import moment from 'moment';
//# sourceMappingURL=getAge.d.mts.map