112 lines
3.5 KiB
JavaScript
112 lines
3.5 KiB
JavaScript
|
"use strict";
|
||
|
|
||
|
Object.defineProperty(exports, "__esModule", {
|
||
|
value: true
|
||
|
});
|
||
|
exports.default = void 0;
|
||
|
|
||
|
var _index = _interopRequireDefault(require("../../../_lib/buildMatchFn/index.js"));
|
||
|
|
||
|
var _index2 = _interopRequireDefault(require("../../../_lib/buildMatchPatternFn/index.js"));
|
||
|
|
||
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
|
||
|
var matchOrdinalNumberPattern = /^(\d+)(º)?/i;
|
||
|
var parseOrdinalNumberPattern = /\d+/i;
|
||
|
var matchEraPatterns = {
|
||
|
narrow: /^(ac|dc|a|d)/i,
|
||
|
abbreviated: /^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,
|
||
|
wide: /^(antes de cristo|antes da era com[uú]n|despois de cristo|era com[uú]n)/i
|
||
|
};
|
||
|
var parseEraPatterns = {
|
||
|
any: [/^ac/i, /^dc/i],
|
||
|
wide: [/^(antes de cristo|antes da era com[uú]n)/i, /^(despois de cristo|era com[uú]n)/i]
|
||
|
};
|
||
|
var matchQuarterPatterns = {
|
||
|
narrow: /^[1234]/i,
|
||
|
abbreviated: /^T[1234]/i,
|
||
|
wide: /^[1234](º)? trimestre/i
|
||
|
};
|
||
|
var parseQuarterPatterns = {
|
||
|
any: [/1/i, /2/i, /3/i, /4/i]
|
||
|
};
|
||
|
var matchMonthPatterns = {
|
||
|
narrow: /^[xfmasond]/i,
|
||
|
abbreviated: /^(xan|feb|mar|abr|mai|xun|xul|ago|set|out|nov|dec)/i,
|
||
|
wide: /^(xaneiro|febreiro|marzo|abril|maio|xuño|xullo|agosto|setembro|outubro|novembro|decembro)/i
|
||
|
};
|
||
|
var parseMonthPatterns = {
|
||
|
narrow: [/^x/i, /^f/i, /^m/i, /^a/i, /^m/i, /^x/i, /^x/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
|
||
|
any: [/^xan/i, /^feb/i, /^mar/i, /^abr/i, /^mai/i, /^xun/i, /^xul/i, /^ago/i, /^set/i, /^out/i, /^nov/i, /^dec/i]
|
||
|
};
|
||
|
var matchDayPatterns = {
|
||
|
narrow: /^[dlmxvs]/i,
|
||
|
short: /^(do|lu|ma|me|xo|ve|sa)/i,
|
||
|
abbreviated: /^(dom|lun|mar|mer|xov|ven|sab)/i,
|
||
|
wide: /^(domingo|luns|martes|m[eé]rcores|xoves|venres|s[áa]bado)/i
|
||
|
};
|
||
|
var parseDayPatterns = {
|
||
|
narrow: [/^d/i, /^l/i, /^m/i, /^m/i, /^x/i, /^v/i, /^s/i],
|
||
|
any: [/^do/i, /^lu/i, /^ma/i, /^me/i, /^xo/i, /^ve/i, /^sa/i]
|
||
|
};
|
||
|
var matchDayPeriodPatterns = {
|
||
|
narrow: /^(a|p|mn|md|(da|[aá]s) (mañ[aá]|tarde|noite))/i,
|
||
|
any: /^([ap]\.?\s?m\.?|medianoite|mediod[ií]a|(da|[aá]s) (mañ[aá]|tarde|noite))/i
|
||
|
};
|
||
|
var parseDayPeriodPatterns = {
|
||
|
any: {
|
||
|
am: /^a/i,
|
||
|
pm: /^p/i,
|
||
|
midnight: /^mn/i,
|
||
|
noon: /^md/i,
|
||
|
morning: /mañ[aá]/i,
|
||
|
afternoon: /tarde/i,
|
||
|
evening: /tardiña/i,
|
||
|
night: /noite/i
|
||
|
}
|
||
|
};
|
||
|
var match = {
|
||
|
ordinalNumber: (0, _index2.default)({
|
||
|
matchPattern: matchOrdinalNumberPattern,
|
||
|
parsePattern: parseOrdinalNumberPattern,
|
||
|
valueCallback: function valueCallback(value) {
|
||
|
return parseInt(value, 10);
|
||
|
}
|
||
|
}),
|
||
|
era: (0, _index.default)({
|
||
|
matchPatterns: matchEraPatterns,
|
||
|
defaultMatchWidth: 'wide',
|
||
|
parsePatterns: parseEraPatterns,
|
||
|
defaultParseWidth: 'any'
|
||
|
}),
|
||
|
quarter: (0, _index.default)({
|
||
|
matchPatterns: matchQuarterPatterns,
|
||
|
defaultMatchWidth: 'wide',
|
||
|
parsePatterns: parseQuarterPatterns,
|
||
|
defaultParseWidth: 'any',
|
||
|
valueCallback: function valueCallback(index) {
|
||
|
return index + 1;
|
||
|
}
|
||
|
}),
|
||
|
month: (0, _index.default)({
|
||
|
matchPatterns: matchMonthPatterns,
|
||
|
defaultMatchWidth: 'wide',
|
||
|
parsePatterns: parseMonthPatterns,
|
||
|
defaultParseWidth: 'any'
|
||
|
}),
|
||
|
day: (0, _index.default)({
|
||
|
matchPatterns: matchDayPatterns,
|
||
|
defaultMatchWidth: 'wide',
|
||
|
parsePatterns: parseDayPatterns,
|
||
|
defaultParseWidth: 'any'
|
||
|
}),
|
||
|
dayPeriod: (0, _index.default)({
|
||
|
matchPatterns: matchDayPeriodPatterns,
|
||
|
defaultMatchWidth: 'any',
|
||
|
parsePatterns: parseDayPeriodPatterns,
|
||
|
defaultParseWidth: 'any'
|
||
|
})
|
||
|
};
|
||
|
var _default = match;
|
||
|
exports.default = _default;
|
||
|
module.exports = exports.default;
|