Very Popular
Latest
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319var formatDistanceLocale = { lessThanXSeconds: { one: { regular: 'méně než vteřina', past: 'před méně než vteřinou', future: 'za méně než vteřinu' }, few: { regular: 'méně než {{count}} vteřiny', past: 'před méně než {{count}} vteřinami', future: 'za méně než {{count}} vteřiny' }, many: { regular: 'méně než {{count}} vteřin', past: 'před méně než {{count}} vteřinami', future: 'za méně než {{count}} vteřin' } },
xSeconds: { one: { regular: 'vteřina', past: 'před vteřinou', future: 'za vteřinu' }, few: { regular: '{{count}} vteřiny', past: 'před {{count}} vteřinami', future: 'za {{count}} vteřiny' }, many: { regular: '{{count}} vteřin', past: 'před {{count}} vteřinami', future: 'za {{count}} vteřin' } },
halfAMinute: { other: { regular: 'půl minuty', past: 'před půl minutou', future: 'za půl minuty' } },
lessThanXMinutes: { one: { regular: 'méně než minuta', past: 'před méně než minutou', future: 'za méně než minutu' }, few: { regular: 'méně než {{count}} minuty', past: 'před méně než {{count}} minutami', future: 'za méně než {{count}} minuty' }, many: { regular: 'méně než {{count}} minut', past: 'před méně než {{count}} minutami', future: 'za méně než {{count}} minut' } },
xMinutes: { one: { regular: 'minuta', past: 'před minutou', future: 'za minutu' }, few: { regular: '{{count}} minuty', past: 'před {{count}} minutami', future: 'za {{count}} minuty' }, many: { regular: '{{count}} minut', past: 'před {{count}} minutami', future: 'za {{count}} minut' } },
aboutXHours: { one: { regular: 'přibližně hodina', past: 'přibližně před hodinou', future: 'přibližně za hodinu' }, few: { regular: 'přibližně {{count}} hodiny', past: 'přibližně před {{count}} hodinami', future: 'přibližně za {{count}} hodiny' }, many: { regular: 'přibližně {{count}} hodin', past: 'přibližně před {{count}} hodinami', future: 'přibližně za {{count}} hodin' } },
xHours: { one: { regular: 'hodina', past: 'před hodinou', future: 'za hodinu' }, few: { regular: '{{count}} hodiny', past: 'před {{count}} hodinami', future: 'za {{count}} hodiny' }, many: { regular: '{{count}} hodin', past: 'před {{count}} hodinami', future: 'za {{count}} hodin' } },
xDays: { one: { regular: 'den', past: 'před dnem', future: 'za den' }, few: { regular: '{{count}} dny', past: 'před {{count}} dny', future: 'za {{count}} dny' }, many: { regular: '{{count}} dní', past: 'před {{count}} dny', future: 'za {{count}} dní' } },
aboutXWeeks: { one: { regular: 'přibližně týden', past: 'přibližně před týdnem', future: 'přibližně za týden' },
few: { regular: 'přibližně {{count}} týdny', past: 'přibližně před {{count}} týdny', future: 'přibližně za {{count}} týdny' },
many: { regular: 'přibližně {{count}} týdnů', past: 'přibližně před {{count}} týdny', future: 'přibližně za {{count}} týdnů' } },
xWeeks: { one: { regular: 'týden', past: 'před týdnem', future: 'za týden' },
few: { regular: '{{count}} týdny', past: 'před {{count}} týdny', future: 'za {{count}} týdny' },
many: { regular: '{{count}} týdnů', past: 'před {{count}} týdny', future: 'za {{count}} týdnů' } },
aboutXMonths: { one: { regular: 'přibližně měsíc', past: 'přibližně před měsícem', future: 'přibližně za měsíc' },
few: { regular: 'přibližně {{count}} měsíce', past: 'přibližně před {{count}} měsíci', future: 'přibližně za {{count}} měsíce' },
many: { regular: 'přibližně {{count}} měsíců', past: 'přibližně před {{count}} měsíci', future: 'přibližně za {{count}} měsíců' } },
xMonths: { one: { regular: 'měsíc', past: 'před měsícem', future: 'za měsíc' },
few: { regular: '{{count}} měsíce', past: 'před {{count}} měsíci', future: 'za {{count}} měsíce' },
many: { regular: '{{count}} měsíců', past: 'před {{count}} měsíci', future: 'za {{count}} měsíců' } },
aboutXYears: { one: { regular: 'přibližně rok', past: 'přibližně před rokem', future: 'přibližně za rok' }, few: { regular: 'přibližně {{count}} roky', past: 'přibližně před {{count}} roky', future: 'přibližně za {{count}} roky' }, many: { regular: 'přibližně {{count}} roků', past: 'přibližně před {{count}} roky', future: 'přibližně za {{count}} roků' } },
xYears: { one: { regular: 'rok', past: 'před rokem', future: 'za rok' }, few: { regular: '{{count}} roky', past: 'před {{count}} roky', future: 'za {{count}} roky' }, many: { regular: '{{count}} roků', past: 'před {{count}} roky', future: 'za {{count}} roků' } },
overXYears: { one: { regular: 'více než rok', past: 'před více než rokem', future: 'za více než rok' }, few: { regular: 'více než {{count}} roky', past: 'před více než {{count}} roky', future: 'za více než {{count}} roky' }, many: { regular: 'více než {{count}} roků', past: 'před více než {{count}} roky', future: 'za více než {{count}} roků' } },
almostXYears: { one: { regular: 'skoro rok', past: 'skoro před rokem', future: 'skoro za rok' }, few: { regular: 'skoro {{count}} roky', past: 'skoro před {{count}} roky', future: 'skoro za {{count}} roky' }, many: { regular: 'skoro {{count}} roků', past: 'skoro před {{count}} roky', future: 'skoro za {{count}} roků' } }}
export default function formatDistance(token, count, options) { options = options || {} var scheme = formatDistanceLocale[token]
// cs pluralization var pluralToken if (typeof scheme.other === 'object') { pluralToken = 'other' } else if (count === 1) { pluralToken = 'one' } else if ((count > 1 && count < 5) || count === 0) { pluralToken = 'few' } else { pluralToken = 'many' }
// times var suffixExist = options.addSuffix === true var comparison = options.comparison var timeToken if (suffixExist && comparison === -1) { timeToken = 'past' } else if (suffixExist && comparison === 1) { timeToken = 'future' } else { timeToken = 'regular' }
return scheme[pluralToken][timeToken].replace('{{count}}', count)}