Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Croatian, Serbian locale #259

Open
idc77 opened this issue Dec 23, 2022 · 0 comments
Open

Croatian, Serbian locale #259

idc77 opened this issue Dec 23, 2022 · 0 comments

Comments

@idc77
Copy link

idc77 commented Dec 23, 2022

hr.ts

const localeFunc = (number: number, index: number, totalSec: number): [string, string] => {
  // number: the timeago / timein number;
  // index: the index of array below;
  // totalSec: total seconds between date to be formatted and today's date;
  return [
    ['tek sada', 'upravo sada'],
    ['prije %s sekundi', 'za %s sekunde'],
    ['prije 1 minute', 'za 1 minutu'],
    ['prije %s minuta', 'za %s minuta'],
    ['prije 1 sata', 'za 1 sat'],
    ['prije %s sata', 'za %s sata'],
    ['prije 1 dan', 'za 1 dan'],
    ['prije %s dana', 'za %s dana'],
    ['prije 1 tjedan', 'za 1 tjedan'],
    ['prije %s tjedna', 'za %s tjedna'],
    ['prije 1 mjeseca', 'za 1 mjesec'],
    ['prije %s mjeseci', 'za %s mjeseca'],
    ['prije 1 godine', 'za 1 godinu'],
    ['prije %s godina', 'za %s godina']
  ][index];
};

rs.ts

const localeFunc = (number: number, index: number, totalSec: number): [string, string] => {
  // number: the timeago / timein number;
  // index: the index of array below;
  // totalSec: total seconds between date to be formatted and today's date;
  return [
    ['nedavno', 'ovog momenta'],
    ['pre %s sekundi', 'za %s sekunde'],
    ['pre 1 minute', 'za 1 minutu'],
    ['pre %s minuta', 'za %s minuta'],
    ['pre 1 sata', 'za 1 sat'],
    ['pre %s sata', 'za %s sata'],
    ['pre 1 dan', 'za 1 dan'],
    ['pre %s dana', 'za %s dana'],
    ['pre 1 nedelje', 'za 1 nedelju'],
    ['pre %s nedelje', 'za %s nedelju'],
    ['pre 1 mesec', 'za 1 mesec'],
    ['pre %s mesea', 'za %s meseca'],
    ['pre 1 godinu', 'za 1 godinu'],
    ['pre %s godina', 'za %s godina']
  ][index];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant