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