ಮೋಡ್ಯೂಲ್:ConvertTime
ತೊಜುನ
Usage
[ಸಂಪೊಲಿಪುಲೆ]This module was primarily created because the parser function {{#time}} was unable to calculate the Tulu month. This limitation was identified as a bug (Phab:T21412) and reported immediately. Since the bug has now been fixed, this module is no longer necessary and may be removed.
Example:
{{#time:F Y|{{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}If we give: ದೋಷ: ಸಮಯ ತಪ್ಪಾತ್ಂಡ್.
Module syntax
[ಸಂಪೊಲಿಪುಲೆ]{{#invoke:ConvertTime|main|<!-- your text here -->}}
Example, {{#invoke:ConvertTime|main|೧೬:೨೫, ೧೪ ದಸಂಬರ್ ೨೦೨೫ (UTC)}} gives the result "16:25, 14 December 2025 (UTC)"
Example:
{{#time:F Y|{{#invoke:ConvertTime|main|{{CURRENTMONTHNAME}} {{CURRENTYEAR}}}}}}
Output: ಜನವರಿ ೨೦೨೬
This demonstrates that the module correctly converts the date into the localised (Tulu language) month and year format.
See also
[ಸಂಪೊಲಿಪುಲೆ]
local tcy_digits = {
['೦'] = '0',
['೧'] = '1',
['೨'] = '2',
['೩'] = '3',
['೪'] = '4',
['೫'] = '5',
['೬'] = '6',
['೭'] = '7',
['೮'] = '8',
['೯'] = '9',
}
local tcy_months = {
['ಜನವರಿ'] = 'January',
['ಪೆಬ್ರವರಿ'] = 'February',
['ಮಾರ್ಚಿ'] = 'March',
['ಏಪ್ರಿಲ್'] = 'April',
['ಮೇ'] = 'May',
['ಜೂನ್'] = 'June',
['ಜುಲಾಯಿ'] = 'July',
['ಆಗೋಸ್ಟು'] = 'August',
['ಸಪ್ಟೆಂಬರ್'] = 'September',
['ಅಕ್ಟೋಬರ್'] = 'October',
['ನವೆಂಬರ್'] = 'November',
['ದಸಂಬರ್'] = 'December',
}
local function _main(input)
input = input or ''
-- Convert Tulu month names to English
for tcy, en in pairs(tcy_months) do
input = input:gsub(tcy, en)
end
for tcy, en in pairs(tcy_digits)
do
input = input:gsub(tcy, en)
end
return input
end
local function main(frame)
return _main(frame.args[1] or frame:getParent().args[1])
end
return { main = main, _main = _main }