cy.js 2.7 KB

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