const months = [
	"January",
	"February",
	"March",
	"April",
	"May",
	"June",
	"July",
	"August",
	"September",
	"October",
	"November",
	"December",
]

const days = [
	"Monday",
	"Tuesday",
	"Wednesday",
	"Thursday",
	"Friday",
	"Saturday",
	"Sunday",
]

const convertDate = (isoStamp: string) => {
	const unixSeconds = new Date(isoStamp)
	const weekday = days[unixSeconds.getDay()]
	const day = unixSeconds.getDate()
	const month = months[unixSeconds.getMonth()]
	const year = unixSeconds.getFullYear()
	return `${weekday} ${day} ${month} ${year}`
}

export { convertDate }
