ro.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. MM: 'luni',
  14. yy: 'ani',
  15. },
  16. separator = ' ';
  17. if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
  18. separator = ' de ';
  19. }
  20. return number + separator + format[key];
  21. }
  22. export default moment.defineLocale('ro', {
  23. months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(
  24. '_'
  25. ),
  26. monthsShort: 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(
  27. '_'
  28. ),
  29. monthsParseExact: true,
  30. weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  31. weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  32. weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  33. longDateFormat: {
  34. LT: 'H:mm',
  35. LTS: 'H:mm:ss',
  36. L: 'DD.MM.YYYY',
  37. LL: 'D MMMM YYYY',
  38. LLL: 'D MMMM YYYY H:mm',
  39. LLLL: 'dddd, D MMMM YYYY H:mm',
  40. },
  41. calendar: {
  42. sameDay: '[azi la] LT',
  43. nextDay: '[mâine la] LT',
  44. nextWeek: 'dddd [la] LT',
  45. lastDay: '[ieri la] LT',
  46. lastWeek: '[fosta] dddd [la] LT',
  47. sameElse: 'L',
  48. },
  49. relativeTime: {
  50. future: 'peste %s',
  51. past: '%s în urmă',
  52. s: 'câteva secunde',
  53. ss: relativeTimeWithPlural,
  54. m: 'un minut',
  55. mm: relativeTimeWithPlural,
  56. h: 'o oră',
  57. hh: relativeTimeWithPlural,
  58. d: 'o zi',
  59. dd: relativeTimeWithPlural,
  60. M: 'o lună',
  61. MM: relativeTimeWithPlural,
  62. y: 'un an',
  63. yy: relativeTimeWithPlural,
  64. },
  65. week: {
  66. dow: 1, // Monday is the first day of the week.
  67. doy: 7, // The week that contains Jan 7th is the first week of the year.
  68. },
  69. });