Rocky_Mountain_Vending/.pnpm-store/v10/files/ab/820b384bb904e45fc4d52f6e095bcec7726e37bb34ba2c5a749a562e588bf74e09086c4cae70c7ea8e183765a5fb262aaf091f773ad794788ed47bf61669a4
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

115 lines
2.3 KiB
Text

const formatDistanceLocale = {
lessThanXSeconds: {
one: "1びょうみまん",
other: "{{count}}びょうみまん",
oneWithSuffix: "やく1びょう",
otherWithSuffix: "やく{{count}}びょう",
},
xSeconds: {
one: "1びょう",
other: "{{count}}びょう",
},
halfAMinute: "30びょう",
lessThanXMinutes: {
one: "1ぷんみまん",
other: "{{count}}ふんみまん",
oneWithSuffix: "やく1ぷん",
otherWithSuffix: "やく{{count}}ふん",
},
xMinutes: {
one: "1ぷん",
other: "{{count}}ふん",
},
aboutXHours: {
one: "やく1じかん",
other: "やく{{count}}じかん",
},
xHours: {
one: "1じかん",
other: "{{count}}じかん",
},
xDays: {
one: "1にち",
other: "{{count}}にち",
},
aboutXWeeks: {
one: "やく1しゅうかん",
other: "やく{{count}}しゅうかん",
},
xWeeks: {
one: "1しゅうかん",
other: "{{count}}しゅうかん",
},
aboutXMonths: {
one: "やく1かげつ",
other: "やく{{count}}かげつ",
},
xMonths: {
one: "1かげつ",
other: "{{count}}かげつ",
},
aboutXYears: {
one: "やく1ねん",
other: "やく{{count}}ねん",
},
xYears: {
one: "1ねん",
other: "{{count}}ねん",
},
overXYears: {
one: "1ねんいじょう",
other: "{{count}}ねんいじょう",
},
almostXYears: {
one: "1ねんちかく",
other: "{{count}}ねんちかく",
},
};
export const formatDistance = (token, count, options) => {
options = options || {};
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
if (options.addSuffix && tokenValue.oneWithSuffix) {
result = tokenValue.oneWithSuffix;
} else {
result = tokenValue.one;
}
} else {
if (options.addSuffix && tokenValue.otherWithSuffix) {
result = tokenValue.otherWithSuffix.replace("{{count}}", String(count));
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
}
if (options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return result + "あと";
} else {
return result + "まえ";
}
}
return result;
};