Rocky_Mountain_Vending/.pnpm-store/v10/files/89/fad425bc7f95efe0d9df95670cbad1a444ab952e2b3b7e8368eb9e10f3839ae2b30491c96e33d7e5045ba14c4ab50d833f46dcf780457e249fb787e909aba7
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

101 lines
1.8 KiB
Text

const formatDistanceLocale = {
lessThanXSeconds: {
one: "mindre enn ett sekund",
other: "mindre enn {{count}} sekunder",
},
xSeconds: {
one: "ett sekund",
other: "{{count}} sekunder",
},
halfAMinute: "et halvt minutt",
lessThanXMinutes: {
one: "mindre enn ett minutt",
other: "mindre enn {{count}} minutter",
},
xMinutes: {
one: "ett minutt",
other: "{{count}} minutter",
},
aboutXHours: {
one: "omtrent en time",
other: "omtrent {{count}} timer",
},
xHours: {
one: "en time",
other: "{{count}} timer",
},
xDays: {
one: "en dag",
other: "{{count}} dager",
},
aboutXWeeks: {
one: "omtrent en uke",
other: "omtrent {{count}} uker",
},
xWeeks: {
one: "en uke",
other: "{{count}} uker",
},
aboutXMonths: {
one: "omtrent en måned",
other: "omtrent {{count}} måneder",
},
xMonths: {
one: "en måned",
other: "{{count}} måneder",
},
aboutXYears: {
one: "omtrent ett år",
other: "omtrent {{count}} år",
},
xYears: {
one: "ett år",
other: "{{count}} år",
},
overXYears: {
one: "over ett år",
other: "over {{count}} år",
},
almostXYears: {
one: "nesten ett år",
other: "nesten {{count}} år",
},
};
export const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "om " + result;
} else {
return result + " siden";
}
}
return result;
};