cy.js 2.8 KB

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