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