ja.js (3955B)
1//! moment.js locale configuration 2//! locale : Japanese [ja] 3//! author : LI Long : https://github.com/baryon 4 5import moment from '../moment'; 6 7export default moment.defineLocale('ja', { 8 eras: [ 9 { 10 since: '2019-05-01', 11 offset: 1, 12 name: '令和', 13 narrow: '㋿', 14 abbr: 'R', 15 }, 16 { 17 since: '1989-01-08', 18 until: '2019-04-30', 19 offset: 1, 20 name: '平成', 21 narrow: '㍻', 22 abbr: 'H', 23 }, 24 { 25 since: '1926-12-25', 26 until: '1989-01-07', 27 offset: 1, 28 name: '昭和', 29 narrow: '㍼', 30 abbr: 'S', 31 }, 32 { 33 since: '1912-07-30', 34 until: '1926-12-24', 35 offset: 1, 36 name: '大正', 37 narrow: '㍽', 38 abbr: 'T', 39 }, 40 { 41 since: '1873-01-01', 42 until: '1912-07-29', 43 offset: 6, 44 name: '明治', 45 narrow: '㍾', 46 abbr: 'M', 47 }, 48 { 49 since: '0001-01-01', 50 until: '1873-12-31', 51 offset: 1, 52 name: '西暦', 53 narrow: 'AD', 54 abbr: 'AD', 55 }, 56 { 57 since: '0000-12-31', 58 until: -Infinity, 59 offset: 1, 60 name: '紀元前', 61 narrow: 'BC', 62 abbr: 'BC', 63 }, 64 ], 65 eraYearOrdinalRegex: /(元|\d+)年/, 66 eraYearOrdinalParse: function (input, match) { 67 return match[1] === '元' ? 1 : parseInt(match[1] || input, 10); 68 }, 69 months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), 70 monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split( 71 '_' 72 ), 73 weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'), 74 weekdaysShort: '日_月_火_水_木_金_土'.split('_'), 75 weekdaysMin: '日_月_火_水_木_金_土'.split('_'), 76 longDateFormat: { 77 LT: 'HH:mm', 78 LTS: 'HH:mm:ss', 79 L: 'YYYY/MM/DD', 80 LL: 'YYYY年M月D日', 81 LLL: 'YYYY年M月D日 HH:mm', 82 LLLL: 'YYYY年M月D日 dddd HH:mm', 83 l: 'YYYY/MM/DD', 84 ll: 'YYYY年M月D日', 85 lll: 'YYYY年M月D日 HH:mm', 86 llll: 'YYYY年M月D日(ddd) HH:mm', 87 }, 88 meridiemParse: /午前|午後/i, 89 isPM: function (input) { 90 return input === '午後'; 91 }, 92 meridiem: function (hour, minute, isLower) { 93 if (hour < 12) { 94 return '午前'; 95 } else { 96 return '午後'; 97 } 98 }, 99 calendar: { 100 sameDay: '[今日] LT', 101 nextDay: '[明日] LT', 102 nextWeek: function (now) { 103 if (now.week() !== this.week()) { 104 return '[来週]dddd LT'; 105 } else { 106 return 'dddd LT'; 107 } 108 }, 109 lastDay: '[昨日] LT', 110 lastWeek: function (now) { 111 if (this.week() !== now.week()) { 112 return '[先週]dddd LT'; 113 } else { 114 return 'dddd LT'; 115 } 116 }, 117 sameElse: 'L', 118 }, 119 dayOfMonthOrdinalParse: /\d{1,2}日/, 120 ordinal: function (number, period) { 121 switch (period) { 122 case 'y': 123 return number === 1 ? '元年' : number + '年'; 124 case 'd': 125 case 'D': 126 case 'DDD': 127 return number + '日'; 128 default: 129 return number; 130 } 131 }, 132 relativeTime: { 133 future: '%s後', 134 past: '%s前', 135 s: '数秒', 136 ss: '%d秒', 137 m: '1分', 138 mm: '%d分', 139 h: '1時間', 140 hh: '%d時間', 141 d: '1日', 142 dd: '%d日', 143 M: '1ヶ月', 144 MM: '%dヶ月', 145 y: '1年', 146 yy: '%d年', 147 }, 148});