ro.js 2.2KB

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: 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(
  28. '_'
  29. ),
  30. monthsParseExact: true,
  31. weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  32. weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  33. weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  34. longDateFormat: {
  35. LT: 'H:mm',
  36. LTS: 'H:mm:ss',
  37. L: 'DD.MM.YYYY',
  38. LL: 'D MMMM YYYY',
  39. LLL: 'D MMMM YYYY H:mm',
  40. LLLL: 'dddd, D MMMM YYYY H:mm',
  41. },
  42. calendar: {
  43. sameDay: '[azi la] LT',
  44. nextDay: '[mâine la] LT',
  45. nextWeek: 'dddd [la] LT',
  46. lastDay: '[ieri la] LT',
  47. lastWeek: '[fosta] dddd [la] LT',
  48. sameElse: 'L',
  49. },
  50. relativeTime: {
  51. future: 'peste %s',
  52. past: '%s în urmă',
  53. s: 'câteva secunde',
  54. ss: relativeTimeWithPlural,
  55. m: 'un minut',
  56. mm: relativeTimeWithPlural,
  57. h: 'o oră',
  58. hh: relativeTimeWithPlural,
  59. d: 'o zi',
  60. dd: relativeTimeWithPlural,
  61. w: 'o săptămână',
  62. ww: relativeTimeWithPlural,
  63. M: 'o lună',
  64. MM: relativeTimeWithPlural,
  65. y: 'un an',
  66. yy: relativeTimeWithPlural,
  67. },
  68. week: {
  69. dow: 1, // Monday is the first day of the week.
  70. doy: 7, // The week that contains Jan 7th is the first week of the year.
  71. },
  72. });