cy.js 2.8 KB

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