diff options
Diffstat (limited to 'date-fns/src/locale/te/_lib/match/index.js')
-rw-r--r-- | date-fns/src/locale/te/_lib/match/index.js | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/date-fns/src/locale/te/_lib/match/index.js b/date-fns/src/locale/te/_lib/match/index.js new file mode 100644 index 0000000..f5813f6 --- /dev/null +++ b/date-fns/src/locale/te/_lib/match/index.js @@ -0,0 +1,140 @@ +import buildMatchPatternFn from '../../../_lib/buildMatchPatternFn/index' +import buildMatchFn from '../../../_lib/buildMatchFn/index' + +var matchOrdinalNumberPattern = /^(\d+)(వ)?/i +var parseOrdinalNumberPattern = /\d+/i + +var matchEraPatterns = { + narrow: /^(క్రీ\.పూ\.|క్రీ\.శ\.)/i, + abbreviated: /^(క్రీ\.?\s?పూ\.?|ప్ర\.?\s?శ\.?\s?పూ\.?|క్రీ\.?\s?శ\.?|సా\.?\s?శ\.?)/i, + wide: /^(క్రీస్తు పూర్వం|ప్రస్తుత శకానికి పూర్వం|క్రీస్తు శకం|ప్రస్తుత శకం)/i +} +var parseEraPatterns = { + any: [/^(పూ|శ)/i, /^సా/i] +} + +var matchQuarterPatterns = { + narrow: /^[1234]/i, + abbreviated: /^త్రై[1234]/i, + wide: /^[1234](వ)? త్రైమాసికం/i +} +var parseQuarterPatterns = { + any: [/1/i, /2/i, /3/i, /4/i] +} + +var matchMonthPatterns = { + narrow: /^(జూ|జు|జ|ఫి|మా|ఏ|మే|ఆ|సె|అ|న|డి)/i, + abbreviated: /^(జన|ఫిబ్ర|మార్చి|ఏప్రి|మే|జూన్|జులై|ఆగ|సెప్|అక్టో|నవ|డిసె)/i, + wide: /^(జనవరి|ఫిబ్రవరి|మార్చి|ఏప్రిల్|మే|జూన్|జులై|ఆగస్టు|సెప్టెంబర్|అక్టోబర్|నవంబర్|డిసెంబర్)/i +} + +var parseMonthPatterns = { + narrow: [ + /^జ/i, + /^ఫి/i, + /^మా/i, + /^ఏ/i, + /^మే/i, + /^జూ/i, + /^జు/i, + /^ఆ/i, + /^సె/i, + /^అ/i, + /^న/i, + /^డి/i + ], + any: [ + /^జన/i, + /^ఫి/i, + /^మా/i, + /^ఏ/i, + /^మే/i, + /^జూన్/i, + /^జులై/i, + /^ఆగ/i, + /^సె/i, + /^అ/i, + /^న/i, + /^డి/i + ] +} + +var matchDayPatterns = { + narrow: /^(ఆ|సో|మ|బు|గు|శు|శ)/i, + short: /^(ఆది|సోమ|మం|బుధ|గురు|శుక్ర|శని)/i, + abbreviated: /^(ఆది|సోమ|మం|బుధ|గురు|శుక్ర|శని)/i, + wide: /^(ఆదివారం|సోమవారం|మంగళవారం|బుధవారం|గురువారం|శుక్రవారం|శనివారం)/i +} + +var parseDayPatterns = { + narrow: [/^ఆ/i, /^సో/i, /^మ/i, /^బు/i, /^గు/i, /^శు/i, /^శ/i], + any: [/^ఆది/i, /^సోమ/i, /^మం/i, /^బుధ/i, /^గురు/i, /^శుక్ర/i, /^శని/i] +} + +var matchDayPeriodPatterns = { + narrow: /^(పూర్వాహ్నం|అపరాహ్నం|అర్ధరాత్రి|మిట్టమధ్యాహ్నం|ఉదయం|మధ్యాహ్నం|సాయంత్రం|రాత్రి)/i, + any: /^(పూర్వాహ్నం|అపరాహ్నం|అర్ధరాత్రి|మిట్టమధ్యాహ్నం|ఉదయం|మధ్యాహ్నం|సాయంత్రం|రాత్రి)/i +} + +var parseDayPeriodPatterns = { + any: { + am: /^పూర్వాహ్నం/i, + pm: /^అపరాహ్నం/i, + midnight: /^అర్ధ/i, + noon: /^మిట్ట/i, + morning: /ఉదయం/i, + afternoon: /మధ్యాహ్నం/i, + evening: /సాయంత్రం/i, + night: /రాత్రి/i + } +} + +var match = { + ordinalNumber: buildMatchPatternFn({ + matchPattern: matchOrdinalNumberPattern, + parsePattern: parseOrdinalNumberPattern, + valueCallback: function(value) { + return parseInt(value, 10) + } + }), + + era: buildMatchFn({ + matchPatterns: matchEraPatterns, + defaultMatchWidth: 'wide', + parsePatterns: parseEraPatterns, + defaultParseWidth: 'any' + }), + + quarter: buildMatchFn({ + matchPatterns: matchQuarterPatterns, + defaultMatchWidth: 'wide', + parsePatterns: parseQuarterPatterns, + defaultParseWidth: 'any', + valueCallback: function(index) { + return index + 1 + } + }), + + month: buildMatchFn({ + matchPatterns: matchMonthPatterns, + defaultMatchWidth: 'wide', + parsePatterns: parseMonthPatterns, + defaultParseWidth: 'any' + }), + + day: buildMatchFn({ + matchPatterns: matchDayPatterns, + defaultMatchWidth: 'wide', + parsePatterns: parseDayPatterns, + defaultParseWidth: 'any' + }), + + dayPeriod: buildMatchFn({ + matchPatterns: matchDayPeriodPatterns, + defaultMatchWidth: 'any', + parsePatterns: parseDayPeriodPatterns, + defaultParseWidth: 'any' + }) +} + +export default match |