πŸ“„ formatDistance.cjs
/home/palash/git/site/node_modules/date-fns/locale/zh-HK/_lib/formatDistance.cjs
Language: cjs β€’ Lines: 105
"use strict";
exports.formatDistance = void 0;

const formatDistanceLocale = {
  lessThanXSeconds: {
    one: "ε°‘ζ–Ό 1 η§’",
    other: "ε°‘ζ–Ό {{count}} η§’",
  },

  xSeconds: {
    one: "1 η§’",
    other: "{{count}} η§’",
  },

  halfAMinute: "εŠεˆ†ι˜",

  lessThanXMinutes: {
    one: "ε°‘ζ–Ό 1 εˆ†ι˜",
    other: "ε°‘ζ–Ό {{count}} εˆ†ι˜",
  },

  xMinutes: {
    one: "1 εˆ†ι˜",
    other: "{{count}} εˆ†ι˜",
  },

  xHours: {
    one: "1 小時",
    other: "{{count}} 小時",
  },

  aboutXHours: {
    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}} εΉ΄",
  },
};

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 result + "ε…§";
    } else {
      return result + "前";
    }
  }

  return result;
};
exports.formatDistance = formatDistance;