Rocky_Mountain_Vending/.pnpm-store/v10/files/37/8ea72d5d5182addf4695f3f1f0abec4a43007cae1784b6324903339bff9586e10dacfacaf7fbad182d6f5e5bc9e45e9738c23f848982ea0a932a7ac996ffef
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
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>
2026-02-12 16:22:15 -07:00

31 lines
887 B
Text

import { isSameWeek } from "../../../isSameWeek.js";
function checkWeek(date, baseDate, options) {
const baseFormat = "eeee p";
if (isSameWeek(date, baseDate, options)) {
return baseFormat; // in same week
} else if (date.getTime() > baseDate.getTime()) {
return "'下个'" + baseFormat; // in next week
}
return "'上个'" + baseFormat; // in last week
}
const formatRelativeLocale = {
lastWeek: checkWeek, // days before yesterday, maybe in this week or last week
yesterday: "'昨天' p",
today: "'今天' p",
tomorrow: "'明天' p",
nextWeek: checkWeek, // days after tomorrow, maybe in this week or next week
other: "PP p",
};
export const formatRelative = (token, date, baseDate, options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date, baseDate, options);
}
return format;
};