Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
392 B
Text
15 lines
392 B
Text
export const iso8601 = (time) => toDate(time)
|
|
.toISOString()
|
|
.replace(/\.\d{3}Z$/, "Z");
|
|
export const toDate = (time) => {
|
|
if (typeof time === "number") {
|
|
return new Date(time * 1000);
|
|
}
|
|
if (typeof time === "string") {
|
|
if (Number(time)) {
|
|
return new Date(Number(time) * 1000);
|
|
}
|
|
return new Date(time);
|
|
}
|
|
return time;
|
|
};
|