import moment from "moment";

function subtractDaysFromDate(date: number, days: number, format: string = 'YYYY-MM-DD') {
	date = Number(date);
	days = Number(days);
	const specificDate = moment(date);
	specificDate.subtract(days, 'days');
	return specificDate.format(format);
}

export default subtractDaysFromDate;
