Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ea4533
commit 4695163
Showing
12 changed files
with
1,030 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
var formatDistanceLocale = { | ||
lessThanXSeconds: { | ||
one: { | ||
default: 'ஒரு வினாடிக்கு குறைவாக', | ||
in: 'ஒரு வினாடிக்குள்', | ||
ago: 'ஒரு வினாடிக்கு முன்பு' | ||
}, | ||
other: { | ||
default: '{{count}} வினாடிகளுக்கு குறைவாக', | ||
in: '{{count}} வினாடிகளுக்குள்', | ||
ago: '{{count}} வினாடிகளுக்கு முன்பு' | ||
} | ||
}, | ||
|
||
xSeconds: { | ||
one: { | ||
default: '1 வினாடி', | ||
in: '1 வினாடியில்', | ||
ago: '1 வினாடி முன்பு' | ||
}, | ||
other: { | ||
default: '{{count}} விநாடிகள்', | ||
in: '{{count}} வினாடிகளில்', | ||
ago: '{{count}} விநாடிகளுக்கு முன்பு' | ||
} | ||
}, | ||
|
||
halfAMinute: { | ||
default: 'அரை நிமிடம்', | ||
in: 'அரை நிமிடத்தில்', | ||
ago: 'அரை நிமிடம் முன்பு' | ||
}, | ||
|
||
lessThanXMinutes: { | ||
one: { | ||
default: 'ஒரு நிமிடத்திற்கும் குறைவாக', | ||
in: 'ஒரு நிமிடத்திற்குள்', | ||
ago: 'ஒரு நிமிடத்திற்கு முன்பு' | ||
}, | ||
other: { | ||
default: '{{count}} நிமிடங்களுக்கும் குறைவாக', | ||
in: '{{count}} நிமிடங்களுக்குள்', | ||
ago: '{{count}} நிமிடங்களுக்கு முன்பு' | ||
} | ||
}, | ||
|
||
xMinutes: { | ||
one: { | ||
default: '1 நிமிடம்', | ||
in: '1 நிமிடத்தில்', | ||
ago: '1 நிமிடம் முன்பு' | ||
}, | ||
other: { | ||
default: '{{count}} நிமிடங்கள்', | ||
in: '{{count}} நிமிடங்களில்', | ||
ago: '{{count}} நிமிடங்களுக்கு முன்பு' | ||
} | ||
}, | ||
|
||
aboutXHours: { | ||
one: { | ||
default: 'சுமார் 1 மணி நேரம்', | ||
in: 'சுமார் 1 மணி நேரத்தில்', | ||
ago: 'சுமார் 1 மணி நேரத்திற்கு முன்பு' | ||
}, | ||
other: { | ||
default: 'சுமார் {{count}} மணி நேரம்', | ||
in: 'சுமார் {{count}} மணி நேரத்திற்கு முன்பு', | ||
ago: 'சுமார் {{count}} மணி நேரத்தில்' | ||
} | ||
}, | ||
|
||
xHours: { | ||
one: { | ||
default: '1 மணி நேரம்', | ||
in: '1 மணி நேரத்தில்', | ||
ago: '1 மணி நேரத்திற்கு முன்பு' | ||
}, | ||
other: { | ||
default: '{{count}} மணி நேரம்', | ||
in: '{{count}} மணி நேரத்தில்', | ||
ago: '{{count}} மணி நேரத்திற்கு முன்பு' | ||
} | ||
}, | ||
|
||
xDays: { | ||
one: { | ||
default: '1 நாள்', | ||
in: '1 நாளில்', | ||
ago: '1 நாள் முன்பு' | ||
}, | ||
other: { | ||
default: '{{count}} நாட்கள்', | ||
in: '{{count}} நாட்களில்', | ||
ago: '{{count}} நாட்களுக்கு முன்பு' | ||
} | ||
}, | ||
|
||
aboutXMonths: { | ||
one: { | ||
default: 'சுமார் 1 மாதம்', | ||
in: 'சுமார் 1 மாதத்தில்', | ||
ago: 'சுமார் 1 மாதத்திற்கு முன்பு' | ||
}, | ||
other: { | ||
default: 'சுமார் {{count}} மாதங்கள்', | ||
in: 'சுமார் {{count}} மாதங்களில்', | ||
ago: 'சுமார் {{count}} மாதங்களுக்கு முன்பு' | ||
} | ||
}, | ||
|
||
xMonths: { | ||
one: { | ||
default: '1 மாதம்', | ||
in: '1 மாதத்தில்', | ||
ago: '1 மாதம் முன்பு' | ||
}, | ||
other: { | ||
default: '{{count}} மாதங்கள்', | ||
in: '{{count}} மாதங்களில்', | ||
ago: '{{count}} மாதங்களுக்கு முன்பு' | ||
} | ||
}, | ||
|
||
aboutXYears: { | ||
one: { | ||
default: 'சுமார் 1 வருடம்', | ||
in: 'சுமார் 1 ஆண்டில்', | ||
ago: 'சுமார் 1 வருடம் முன்பு' | ||
}, | ||
other: { | ||
default: 'சுமார் {{count}} ஆண்டுகள்', | ||
in: 'சுமார் {{count}} ஆண்டுகளில்', | ||
ago: 'சுமார் {{count}} ஆண்டுகளுக்கு முன்பு' | ||
} | ||
}, | ||
|
||
xYears: { | ||
one: { | ||
default: '1 வருடம்', | ||
in: '1 ஆண்டில்', | ||
ago: '1 வருடம் முன்பு' | ||
}, | ||
other: { | ||
default: '{{count}} ஆண்டுகள்', | ||
in: '{{count}} ஆண்டுகளில்', | ||
ago: '{{count}} ஆண்டுகளுக்கு முன்பு' | ||
} | ||
}, | ||
|
||
overXYears: { | ||
one: { | ||
default: '1 வருடத்திற்கு மேல்', | ||
in: '1 வருடத்திற்கும் மேலாக', | ||
ago: '1 வருடம் முன்பு' | ||
}, | ||
other: { | ||
default: '{{count}} ஆண்டுகளுக்கும் மேலாக', | ||
in: '{{count}} ஆண்டுகளில்', | ||
ago: '{{count}} ஆண்டுகளுக்கு முன்பு' | ||
} | ||
}, | ||
|
||
almostXYears: { | ||
one: { | ||
default: 'கிட்டத்தட்ட 1 வருடம்', | ||
in: 'கிட்டத்தட்ட 1 ஆண்டில்', | ||
ago: 'கிட்டத்தட்ட 1 வருடம் முன்பு' | ||
}, | ||
other: { | ||
default: 'கிட்டத்தட்ட {{count}} ஆண்டுகள்', | ||
in: 'கிட்டத்தட்ட {{count}} ஆண்டுகளில்', | ||
ago: 'கிட்டத்தட்ட {{count}} ஆண்டுகளுக்கு முன்பு' | ||
} | ||
} | ||
} | ||
|
||
function getFormatDistanceLocaleWithSuffix(resultObj, options) { | ||
if (options.addSuffix) { | ||
if (options.comparison > 0) { | ||
return resultObj.in | ||
} else { | ||
return resultObj.ago | ||
} | ||
} | ||
|
||
return resultObj.default | ||
} | ||
|
||
export default function formatDistance(token, count, options = {}) { | ||
var result | ||
if (formatDistanceLocale[token].default) { | ||
result = getFormatDistanceLocaleWithSuffix( | ||
formatDistanceLocale[token], | ||
options | ||
) | ||
} else if (count === 1) { | ||
result = getFormatDistanceLocaleWithSuffix( | ||
formatDistanceLocale[token].one, | ||
options | ||
) | ||
} else { | ||
result = getFormatDistanceLocaleWithSuffix( | ||
formatDistanceLocale[token].other, | ||
options | ||
) | ||
} | ||
|
||
return result.replace('{{count}}', count) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Ref: https://www.unicode.org/cldr/charts/32/summary/ta.html | ||
|
||
import buildFormatLongFn from '../../../_lib/buildFormatLongFn/index.js' | ||
|
||
// CLDR #1846 - #1849 | ||
var dateFormats = { | ||
full: 'EEEE, d MMMM, y', | ||
long: 'd MMMM, y', | ||
medium: 'd MMM, y', | ||
short: 'd/M/yy' | ||
} | ||
|
||
// CLDR #1850 - #1853 | ||
var timeFormats = { | ||
full: 'a h:mm:ss zzzz', | ||
long: 'a h:mm:ss z', | ||
medium: 'a h:mm:ss', | ||
short: 'a 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: 'full' | ||
}), | ||
|
||
dateTime: buildFormatLongFn({ | ||
formats: dateTimeFormats, | ||
defaultWidth: 'full' | ||
}) | ||
} | ||
|
||
export default formatLong |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var formatRelativeLocale = { | ||
lastWeek: "'கடந்த' eeee p 'மணிக்கு'", | ||
yesterday: "'நேற்று ' p 'மணிக்கு'", | ||
today: "'இன்று ' p 'மணிக்கு'", | ||
tomorrow: "'நாளை ' p 'மணிக்கு'", | ||
nextWeek: "eeee p 'மணிக்கு'", | ||
other: 'P' | ||
} | ||
|
||
export default function formatRelative(token, _date, _baseDate, _options) { | ||
return formatRelativeLocale[token] | ||
} |
Oops, something went wrong.