diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-28 17:26:46 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-28 17:43:56 -0700 |
| commit | e4fa1e69e7ebfb627c7198fd1a9881e9327ec4d4 (patch) | |
| tree | 06284a538a6008eca75051399e47db4e5d50301c /node_modules/date-fns/esm/locale/th | |
initial commit: scaffolding
Diffstat (limited to 'node_modules/date-fns/esm/locale/th')
9 files changed, 419 insertions, 0 deletions
diff --git a/node_modules/date-fns/esm/locale/th/_lib/formatDistance/index.js b/node_modules/date-fns/esm/locale/th/_lib/formatDistance/index.js new file mode 100644 index 0000000..876925e --- /dev/null +++ b/node_modules/date-fns/esm/locale/th/_lib/formatDistance/index.js @@ -0,0 +1,87 @@ +var formatDistanceLocale = { + lessThanXSeconds: { + one: 'น้อยกว่า 1 วินาที', + other: 'น้อยกว่า {{count}} วินาที' + }, + xSeconds: { + one: '1 วินาที', + other: '{{count}} วินาที' + }, + halfAMinute: 'ครึ่งนาที', + lessThanXMinutes: { + one: 'น้อยกว่า 1 นาที', + other: 'น้อยกว่า {{count}} นาที' + }, + xMinutes: { + one: '1 นาที', + other: '{{count}} นาที' + }, + aboutXHours: { + one: 'ประมาณ 1 ชั่วโมง', + other: 'ประมาณ {{count}} ชั่วโมง' + }, + xHours: { + one: '1 ชั่วโมง', + other: '{{count}} ชั่วโมง' + }, + xDays: { + one: '1 วัน', + other: '{{count}} วัน' + }, + aboutXWeeks: { + one: 'ประมาณ 1 สัปดาห์', + other: 'ประมาณ {{count}} สัปดาห์' + }, + xWeeks: { + one: '1 สัปดาห์', + other: '{{count}} สัปดาห์' + }, + aboutXMonths: { + one: 'ประมาณ 1 เดือน', + other: 'ประมาณ {{count}} เดือน' + }, + xMonths: { + one: '1 เดือน', + other: '{{count}} เดือน' + }, + aboutXYears: { + one: 'ประมาณ 1 ปี', + other: 'ประมาณ {{count}} ปี' + }, + xYears: { + one: '1 ปี', + other: '{{count}} ปี' + }, + overXYears: { + one: 'มากกว่า 1 ปี', + other: 'มากกว่า {{count}} ปี' + }, + almostXYears: { + one: 'เกือบ 1 ปี', + other: 'เกือบ {{count}} ปี' + } +}; +var formatDistance = function formatDistance(token, count, options) { + var result; + var tokenValue = formatDistanceLocale[token]; + if (typeof tokenValue === 'string') { + result = tokenValue; + } else if (count === 1) { + result = tokenValue.one; + } else { + result = tokenValue.other.replace('{{count}}', String(count)); + } + if (options !== null && options !== void 0 && options.addSuffix) { + if (options.comparison && options.comparison > 0) { + if (token === 'halfAMinute') { + return 'ใน' + result; + } else { + return 'ใน ' + result; + } + } else { + return result + 'ที่ผ่านมา'; + } + } + return result; +}; +export default formatDistance;
\ No newline at end of file diff --git a/node_modules/date-fns/esm/locale/th/_lib/formatLong/index.js b/node_modules/date-fns/esm/locale/th/_lib/formatLong/index.js new file mode 100644 index 0000000..2fe6226 --- /dev/null +++ b/node_modules/date-fns/esm/locale/th/_lib/formatLong/index.js @@ -0,0 +1,34 @@ +import buildFormatLongFn from "../../../_lib/buildFormatLongFn/index.js"; +var dateFormats = { + full: 'วันEEEEที่ do MMMM y', + long: 'do MMMM y', + medium: 'd MMM y', + short: 'dd/MM/yyyy' +}; +var timeFormats = { + full: 'H:mm:ss น. zzzz', + long: 'H:mm:ss น. z', + medium: 'H:mm:ss น.', + short: 'H:mm น.' +}; +var dateTimeFormats = { + full: "{{date}} 'เวลา' {{time}}", + long: "{{date}} 'เวลา' {{time}}", + medium: '{{date}}, {{time}}', + short: '{{date}}, {{time}}' +}; +var formatLong = { + date: buildFormatLongFn({ + formats: dateFormats, + defaultWidth: 'full' + }), + time: buildFormatLongFn({ + formats: timeFormats, + defaultWidth: 'medium' + }), + dateTime: buildFormatLongFn({ + formats: dateTimeFormats, + defaultWidth: 'full' + }) +}; +export default formatLong;
\ No newline at end of file diff --git a/node_modules/date-fns/esm/locale/th/_lib/formatRelative/index.js b/node_modules/date-fns/esm/locale/th/_lib/formatRelative/index.js new file mode 100644 index 0000000..e964088 --- /dev/null +++ b/node_modules/date-fns/esm/locale/th/_lib/formatRelative/index.js @@ -0,0 +1,12 @@ +var formatRelativeLocale = { + lastWeek: "eeee'ที่แล้วเวลา' p", + yesterday: "'เมื่อวานนี้เวลา' p", + today: "'วันนี้เวลา' p", + tomorrow: "'พรุ่งนี้เวลา' p", + nextWeek: "eeee 'เวลา' p", + other: 'P' +}; +var formatRelative = function formatRelative(token, _date, _baseDate, _options) { + return formatRelativeLocale[token]; +}; +export default formatRelative;
\ No newline at end of file diff --git a/node_modules/date-fns/esm/locale/th/_lib/localize/index.js b/node_modules/date-fns/esm/locale/th/_lib/localize/index.js new file mode 100644 index 0000000..05c6aa0 --- /dev/null +++ b/node_modules/date-fns/esm/locale/th/_lib/localize/index.js @@ -0,0 +1,118 @@ +import buildLocalizeFn from "../../../_lib/buildLocalizeFn/index.js"; +var eraValues = { + narrow: ['B', 'คศ'], + abbreviated: ['BC', 'ค.ศ.'], + wide: ['ปีก่อนคริสตกาล', 'คริสต์ศักราช'] +}; +var quarterValues = { + narrow: ['1', '2', '3', '4'], + abbreviated: ['Q1', 'Q2', 'Q3', 'Q4'], + wide: ['ไตรมาสแรก', 'ไตรมาสที่สอง', 'ไตรมาสที่สาม', 'ไตรมาสที่สี่'] +}; +var dayValues = { + narrow: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], + short: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], + abbreviated: ['อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'], + wide: ['อาทิตย์', 'จันทร์', 'อังคาร', 'พุธ', 'พฤหัสบดี', 'ศุกร์', 'เสาร์'] +}; +var monthValues = { + narrow: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], + abbreviated: ['ม.ค.', 'ก.พ.', 'มี.ค.', 'เม.ย.', 'พ.ค.', 'มิ.ย.', 'ก.ค.', 'ส.ค.', 'ก.ย.', 'ต.ค.', 'พ.ย.', 'ธ.ค.'], + wide: ['มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'] +}; +var dayPeriodValues = { + narrow: { + am: 'ก่อนเที่ยง', + pm: 'หลังเที่ยง', + midnight: 'เที่ยงคืน', + noon: 'เที่ยง', + morning: 'เช้า', + afternoon: 'บ่าย', + evening: 'เย็น', + night: 'กลางคืน' + }, + abbreviated: { + am: 'ก่อนเที่ยง', + pm: 'หลังเที่ยง', + midnight: 'เที่ยงคืน', + noon: 'เที่ยง', + morning: 'เช้า', + afternoon: 'บ่าย', + evening: 'เย็น', + night: 'กลางคืน' + }, + wide: { + am: 'ก่อนเที่ยง', + pm: 'หลังเที่ยง', + midnight: 'เที่ยงคืน', + noon: 'เที่ยง', + morning: 'เช้า', + afternoon: 'บ่าย', + evening: 'เย็น', + night: 'กลางคืน' + } +}; +var formattingDayPeriodValues = { + narrow: { + am: 'ก่อนเที่ยง', + pm: 'หลังเที่ยง', + midnight: 'เที่ยงคืน', + noon: 'เที่ยง', + morning: 'ตอนเช้า', + afternoon: 'ตอนกลางวัน', + evening: 'ตอนเย็น', + night: 'ตอนกลางคืน' + }, + abbreviated: { + am: 'ก่อนเที่ยง', + pm: 'หลังเที่ยง', + midnight: 'เที่ยงคืน', + noon: 'เที่ยง', + morning: 'ตอนเช้า', + afternoon: 'ตอนกลางวัน', + evening: 'ตอนเย็น', + night: 'ตอนกลางคืน' + }, + wide: { + am: 'ก่อนเที่ยง', + pm: 'หลังเที่ยง', + midnight: 'เที่ยงคืน', + noon: 'เที่ยง', + morning: 'ตอนเช้า', + afternoon: 'ตอนกลางวัน', + evening: 'ตอนเย็น', + night: 'ตอนกลางคืน' + } +}; +var ordinalNumber = function ordinalNumber(dirtyNumber, _options) { + return String(dirtyNumber); +}; +var localize = { + ordinalNumber: ordinalNumber, + era: buildLocalizeFn({ + values: eraValues, + defaultWidth: 'wide' + }), + quarter: buildLocalizeFn({ + values: quarterValues, + defaultWidth: 'wide', + argumentCallback: function argumentCallback(quarter) { + return quarter - 1; + } + }), + month: buildLocalizeFn({ + values: monthValues, + defaultWidth: 'wide' + }), + day: buildLocalizeFn({ + values: dayValues, + defaultWidth: 'wide' + }), + dayPeriod: buildLocalizeFn({ + values: dayPeriodValues, + defaultWidth: 'wide', + formattingValues: formattingDayPeriodValues, + defaultFormattingWidth: 'wide' + }) +}; +export default localize;
\ No newline at end of file diff --git a/node_modules/date-fns/esm/locale/th/_lib/match/index.js b/node_modules/date-fns/esm/locale/th/_lib/match/index.js new file mode 100644 index 0000000..f0f7c7e --- /dev/null +++ b/node_modules/date-fns/esm/locale/th/_lib/match/index.js @@ -0,0 +1,97 @@ +import buildMatchFn from "../../../_lib/buildMatchFn/index.js"; +import buildMatchPatternFn from "../../../_lib/buildMatchPatternFn/index.js"; +var matchOrdinalNumberPattern = /^\d+/i; +var parseOrdinalNumberPattern = /\d+/i; +var matchEraPatterns = { + narrow: /^([bB]|[aA]|คศ)/i, + abbreviated: /^([bB]\.?\s?[cC]\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?|ค\.?ศ\.?)/i, + wide: /^(ก่อนคริสตกาล|คริสต์ศักราช|คริสตกาล)/i +}; +var parseEraPatterns = { + any: [/^[bB]/i, /^(^[aA]|ค\.?ศ\.?|คริสตกาล|คริสต์ศักราช|)/i] +}; +var matchQuarterPatterns = { + narrow: /^[1234]/i, + abbreviated: /^q[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 = { + wide: [/^มก/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 = { + wide: [/^อา/i, /^จั/i, /^อั/i, /^พุธ/i, /^พฤ/i, /^ศ/i, /^เส/i], + any: [/^อา/i, /^จ/i, /^อ/i, /^พ(?!ฤ)/i, /^พฤ/i, /^ศ/i, /^ส/i] +}; +var matchDayPeriodPatterns = { + 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 valueCallback(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 valueCallback(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;
\ No newline at end of file diff --git a/node_modules/date-fns/esm/locale/th/index.d.ts b/node_modules/date-fns/esm/locale/th/index.d.ts new file mode 100644 index 0000000..944dd87 --- /dev/null +++ b/node_modules/date-fns/esm/locale/th/index.d.ts @@ -0,0 +1,4 @@ +// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it. + +import { th } from 'date-fns/locale' +export default th diff --git a/node_modules/date-fns/esm/locale/th/index.js b/node_modules/date-fns/esm/locale/th/index.js new file mode 100644 index 0000000..90212d4 --- /dev/null +++ b/node_modules/date-fns/esm/locale/th/index.js @@ -0,0 +1,28 @@ +import formatDistance from "./_lib/formatDistance/index.js"; +import formatLong from "./_lib/formatLong/index.js"; +import formatRelative from "./_lib/formatRelative/index.js"; +import localize from "./_lib/localize/index.js"; +import match from "./_lib/match/index.js"; +/** + * @type {Locale} + * @category Locales + * @summary Thai locale. + * @language Thai + * @iso-639-2 tha + * @author Athiwat Hirunworawongkun [@athivvat]{@link https://github.com/athivvat} + * @author [@hawkup]{@link https://github.com/hawkup} + * @author Jirawat I. [@nodtem66]{@link https://github.com/nodtem66} + */ +var locale = { + code: 'th', + formatDistance: formatDistance, + formatLong: formatLong, + formatRelative: formatRelative, + localize: localize, + match: match, + options: { + weekStartsOn: 0 /* Sunday */, + firstWeekContainsDate: 1 + } +}; +export default locale;
\ No newline at end of file diff --git a/node_modules/date-fns/esm/locale/th/index.js.flow b/node_modules/date-fns/esm/locale/th/index.js.flow new file mode 100644 index 0000000..b9dfe66 --- /dev/null +++ b/node_modules/date-fns/esm/locale/th/index.js.flow @@ -0,0 +1,35 @@ +// @flow +// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it. + +export type Locale = { + code?: string, + formatDistance?: (...args: Array<any>) => any, + formatRelative?: (...args: Array<any>) => any, + localize?: { + ordinalNumber: (...args: Array<any>) => any, + era: (...args: Array<any>) => any, + quarter: (...args: Array<any>) => any, + month: (...args: Array<any>) => any, + day: (...args: Array<any>) => any, + dayPeriod: (...args: Array<any>) => any, + }, + formatLong?: { + date: (...args: Array<any>) => any, + time: (...args: Array<any>) => any, + dateTime: (...args: Array<any>) => any, + }, + match?: { + ordinalNumber: (...args: Array<any>) => any, + era: (...args: Array<any>) => any, + quarter: (...args: Array<any>) => any, + month: (...args: Array<any>) => any, + day: (...args: Array<any>) => any, + dayPeriod: (...args: Array<any>) => any, + }, + options?: { + weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6, + firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7, + }, +} + +declare module.exports: Locale diff --git a/node_modules/date-fns/esm/locale/th/package.json b/node_modules/date-fns/esm/locale/th/package.json new file mode 100644 index 0000000..a7398d8 --- /dev/null +++ b/node_modules/date-fns/esm/locale/th/package.json @@ -0,0 +1,4 @@ +{ + "sideEffects": false, + "typings": "../../../typings.d.ts" +}
\ No newline at end of file |
