cy.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // moment.js locale configuration
  2. // locale : Welsh (cy)
  3. // author : Robert Allen
  4. (function (factory) {
  5. if (typeof define === 'function' && define.amd) {
  6. define(['moment'], factory); // AMD
  7. } else if (typeof exports === 'object') {
  8. module.exports = factory(require('../moment')); // Node
  9. } else {
  10. factory((typeof global !== 'undefined' ? global : this).moment); // node or other global
  11. }
  12. }(function (moment) {
  13. return moment.defineLocale('cy', {
  14. months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'),
  15. monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'),
  16. weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'),
  17. weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
  18. weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
  19. // time formats are the same as en-gb
  20. longDateFormat: {
  21. LT: 'HH:mm',
  22. LTS : 'LT:ss',
  23. L: 'DD/MM/YYYY',
  24. LL: 'D MMMM YYYY',
  25. LLL: 'D MMMM YYYY LT',
  26. LLLL: 'dddd, D MMMM YYYY LT'
  27. },
  28. calendar: {
  29. sameDay: '[Heddiw am] LT',
  30. nextDay: '[Yfory am] LT',
  31. nextWeek: 'dddd [am] LT',
  32. lastDay: '[Ddoe am] LT',
  33. lastWeek: 'dddd [diwethaf am] LT',
  34. sameElse: 'L'
  35. },
  36. relativeTime: {
  37. future: 'mewn %s',
  38. past: '%s yn ôl',
  39. s: 'ychydig eiliadau',
  40. m: 'munud',
  41. mm: '%d munud',
  42. h: 'awr',
  43. hh: '%d awr',
  44. d: 'diwrnod',
  45. dd: '%d diwrnod',
  46. M: 'mis',
  47. MM: '%d mis',
  48. y: 'blwyddyn',
  49. yy: '%d flynedd'
  50. },
  51. ordinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
  52. // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
  53. ordinal: function (number) {
  54. var b = number,
  55. output = '',
  56. lookup = [
  57. '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed
  58. 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed
  59. ];
  60. if (b > 20) {
  61. if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
  62. output = 'fed'; // not 30ain, 70ain or 90ain
  63. } else {
  64. output = 'ain';
  65. }
  66. } else if (b > 0) {
  67. output = lookup[b];
  68. }
  69. return number + output;
  70. },
  71. week : {
  72. dow : 1, // Monday is the first day of the week.
  73. doy : 4 // The week that contains Jan 4th is the first week of the year.
  74. }
  75. });
  76. }));