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.
12 lines • 894 B
text/typescript
/**
* Calculates the time duration between the current time and a given time offset.
*
* @param {number} timeData - The time offset in milliseconds. Can be positive or negative.
* @param {string} [durationType='asSeconds'] - The type of duration to return. Default is `'asSeconds'`. Can be any valid moment.js duration type (e.g., `'asMilliseconds'`, `'asMinutes'`, `'asHours'`, etc.).
* @param {moment.Moment|null} [now=null] - The moment object representing the current date and time. Defaults to the current date and time if not provided.
* @returns {number|null} The calculated duration in the specified unit (default: seconds), or `null` if `timeData` is not provided.
* @deprecated
*/
export default function timeDuration(timeData?: number, durationType?: string, now?: moment.Moment | null): number | null;
import moment from 'moment';
//# sourceMappingURL=timeDuration.d.mts.map