Can I have a TS function that formats a date as "Jul 18, 3:41 PM"
system
Can I have a TS function that formats a date as "Jul 18, 3:41 PM"
user
Here is a TypeScript function that formats a date:

function formatDate(date: Date) {
	return new Intl.DateTimeFormat("default", {
		month: "short",
		day: "numeric",
		hour: "numeric",
		minute: "numeric",
	}).format(date).replace(" at ", ", ");
}
assistant
<|system|>
</s>
<|user|>
Can I have a TS function that formats a date as "Jul 18, 3:41 PM"</s>
<|assistant|>
Here is a TypeScript function that formats a date:

function formatDate(date: Date) {
	return new Intl.DateTimeFormat("default", {
		month: "short",
		day: "numeric",
		hour: "numeric",
		minute: "numeric",
	}).format(date).replace(" at ", ", ");
}</s>
