export function useNotificationDateFormater() {
	return function ( dateString ) {
		let newDate = new Date( dateString );

		let month = ("0" + (newDate.getMonth() + 1)).slice(-2);
		let day = ("0" + newDate.getDate()).slice(-2);

		return newDate.getFullYear() + "-" + month + "-" + day;
	}
}

/**
 * Report helper.
 *
 * @returns Object
 */
export function useReportHelper() {
	function formatNumber(number, fractionDigits = 2) {
		if (typeof number !== 'number') {
			number = Number(number || 0);
		}
		return number.toLocaleString('en-US', { maximumFractionDigits: fractionDigits });
	}

	return { formatNumber };
}
