
//#region src/utils/formatTimeDiff.ts
const formatTimeDiff = (realtiveTime) => {
	const diff = realtiveTime.getTime();
	const MS_IN_SECOND = 1e3;
	const MS_IN_MINUTE = 60 * MS_IN_SECOND;
	const MS_IN_HOUR = 60 * MS_IN_MINUTE;
	const MS_IN_DAY = 24 * MS_IN_HOUR;
	const days = Math.floor(diff / MS_IN_DAY);
	const hours = Math.floor(diff % MS_IN_DAY / MS_IN_HOUR);
	const minutes = Math.floor(diff % MS_IN_HOUR / MS_IN_MINUTE);
	const seconds = Math.floor(diff % MS_IN_MINUTE / MS_IN_SECOND);
	if (days > 0) return `${days}d ${hours}h ${minutes}m ${seconds}s`;
	if (hours > 0) return `${hours}h ${minutes}m ${seconds}s`;
	return `${minutes}m ${seconds}s`;
};

//#endregion
exports.formatTimeDiff = formatTimeDiff;
//# sourceMappingURL=formatTimeDiff.cjs.map