ro.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. //! moment.js locale configuration
  2. //! locale : Romanian [ro]
  3. //! author : Vlad Gurdiga : https://github.com/gurdiga
  4. //! author : Valentin Agachi : https://github.com/avaly
  5. //! author : Emanuel Cepoi : https://github.com/cepem
  6. import moment from '../moment';
  7. function relativeTimeWithPlural(number, withoutSuffix, key) {
  8. var format = {
  9. ss: 'secunde',
  10. mm: 'minute',
  11. hh: 'ore',
  12. dd: 'zile',
  13. ww: 'săptămâni',
  14. MM: 'luni',
  15. yy: 'ani',
  16. },
  17. separator = ' ';
  18. if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
  19. separator = ' de ';
  20. }
  21. return number + separator + format[key];
  22. }
  23. export default moment.defineLocale('ro', {
  24. months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(
  25. '_'
  26. ),
  27. monthsShort:
  28. 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(
  29. '_'
  30. ),
  31. monthsParseExact: true,
  32. weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  33. weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  34. weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  35. longDateFormat: {
  36. LT: 'H:mm',
  37. LTS: 'H:mm:ss',
  38. L: 'DD.MM.YYYY',
  39. LL: 'D MMMM YYYY',
  40. LLL: 'D MMMM YYYY H:mm',
  41. LLLL: 'dddd, D MMMM YYYY H:mm',
  42. },
  43. calendar: {
  44. sameDay: '[azi la] LT',
  45. nextDay: '[mâine la] LT',
  46. nextWeek: 'dddd [la] LT',
  47. lastDay: '[ieri la] LT',
  48. lastWeek: '[fosta] dddd [la] LT',
  49. sameElse: 'L',
  50. },
  51. relativeTime: {
  52. future: 'peste %s',
  53. past: '%s în urmă',
  54. s: 'câteva secunde',
  55. ss: relativeTimeWithPlural,
  56. m: 'un minut',
  57. mm: relativeTimeWithPlural,
  58. h: 'o oră',
  59. hh: relativeTimeWithPlural,
  60. d: 'o zi',
  61. dd: relativeTimeWithPlural,
  62. w: 'o săptămână',
  63. ww: relativeTimeWithPlural,
  64. M: 'o lună',
  65. MM: relativeTimeWithPlural,
  66. y: 'un an',
  67. yy: relativeTimeWithPlural,
  68. },
  69. week: {
  70. dow: 1, // Monday is the first day of the week.
  71. doy: 7, // The week that contains Jan 7th is the first week of the year.
  72. },
  73. });