ro.js 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. (function (factory) {
  6. if (typeof define === 'function' && define.amd) {
  7. define(['moment'], factory); // AMD
  8. } else if (typeof exports === 'object') {
  9. module.exports = factory(require('../moment')); // Node
  10. } else {
  11. factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
  12. }
  13. }(function (moment) {
  14. function relativeTimeWithPlural(number, withoutSuffix, key) {
  15. var format = {
  16. 'mm': 'minute',
  17. 'hh': 'ore',
  18. 'dd': 'zile',
  19. 'MM': 'luni',
  20. 'yy': 'ani'
  21. },
  22. separator = ' ';
  23. if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
  24. separator = ' de ';
  25. }
  26. return number + separator + format[key];
  27. }
  28. return moment.defineLocale('ro', {
  29. months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
  30. monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
  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 : 'LT: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. 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 1st is the first week of the year.
  68. }
  69. });
  70. }));