LaravelTest
110 строк · 3.6 Кб
1//! moment.js locale configuration
2//! locale : Chinese (Taiwan) [zh-tw]
3//! author : Ben : https://github.com/ben-lin
4//! author : Chris Lam : https://github.com/hehachris
5
6;(function (global, factory) {7typeof exports === 'object' && typeof module !== 'undefined'8&& typeof require === 'function' ? factory(require('../moment')) :9typeof define === 'function' && define.amd ? define(['../moment'], factory) :10factory(global.moment)11}(this, (function (moment) { 'use strict';12
13//! moment.js locale configuration14
15var zhTw = moment.defineLocale('zh-tw', {16months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(17'_'18),19monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(20'_'21),22weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),23weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),24weekdaysMin: '日_一_二_三_四_五_六'.split('_'),25longDateFormat: {26LT: 'HH:mm',27LTS: 'HH:mm:ss',28L: 'YYYY/MM/DD',29LL: 'YYYY年M月D日',30LLL: 'YYYY年M月D日 HH:mm',31LLLL: 'YYYY年M月D日dddd HH:mm',32l: 'YYYY/M/D',33ll: 'YYYY年M月D日',34lll: 'YYYY年M月D日 HH:mm',35llll: 'YYYY年M月D日dddd HH:mm',36},37meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,38meridiemHour: function (hour, meridiem) {39if (hour === 12) {40hour = 0;41}42if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {43return hour;44} else if (meridiem === '中午') {45return hour >= 11 ? hour : hour + 12;46} else if (meridiem === '下午' || meridiem === '晚上') {47return hour + 12;48}49},50meridiem: function (hour, minute, isLower) {51var hm = hour * 100 + minute;52if (hm < 600) {53return '凌晨';54} else if (hm < 900) {55return '早上';56} else if (hm < 1130) {57return '上午';58} else if (hm < 1230) {59return '中午';60} else if (hm < 1800) {61return '下午';62} else {63return '晚上';64}65},66calendar: {67sameDay: '[今天] LT',68nextDay: '[明天] LT',69nextWeek: '[下]dddd LT',70lastDay: '[昨天] LT',71lastWeek: '[上]dddd LT',72sameElse: 'L',73},74dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,75ordinal: function (number, period) {76switch (period) {77case 'd':78case 'D':79case 'DDD':80return number + '日';81case 'M':82return number + '月';83case 'w':84case 'W':85return number + '週';86default:87return number;88}89},90relativeTime: {91future: '%s後',92past: '%s前',93s: '幾秒',94ss: '%d 秒',95m: '1 分鐘',96mm: '%d 分鐘',97h: '1 小時',98hh: '%d 小時',99d: '1 天',100dd: '%d 天',101M: '1 個月',102MM: '%d 個月',103y: '1 年',104yy: '%d 年',105},106});107
108return zhTw;109
110})));111