recoder-code
Version:
ð AI-powered development platform - Chat with 32+ models, build projects, automate workflows. Free models included!
87 lines âĒ 2.43 kB
JavaScript
var formatDistanceLocale = {
lessThanXSeconds: {
one: 'āļāđāļāļĒāļāļ§āđāļē 1 āļ§āļīāļāļēāļāļĩ',
other: 'āļāđāļāļĒāļāļ§āđāļē {{count}} āļ§āļīāļāļēāļāļĩ'
},
xSeconds: {
one: '1 āļ§āļīāļāļēāļāļĩ',
other: '{{count}} āļ§āļīāļāļēāļāļĩ'
},
halfAMinute: 'āļāļĢāļķāđāļāļāļēāļāļĩ',
lessThanXMinutes: {
one: 'āļāđāļāļĒāļāļ§āđāļē 1 āļāļēāļāļĩ',
other: 'āļāđāļāļĒāļāļ§āđāļē {{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}} āļāļĩ'
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var 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 !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
if (token === 'halfAMinute') {
return 'āđāļ' + result;
} else {
return 'āđāļ ' + result;
}
} else {
return result + 'āļāļĩāđāļāđāļēāļāļĄāļē';
}
}
return result;
};
export default formatDistance;