Module:Date: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
imported>Lingam
"-- Date functions for use by other modules. -- I18N and time zones are not supported. local MINUS = '−' -- Unicode U+2212 MINUS SIGN local floor = math.floor local Date, DateDiff, diffmt -- forward declarations local uniq = { 'unique identifier' } local function is_date(t) -- The system used to make a date read-only means there is no unique -- metatable t..."-இப்பெயரில் புதிய பக்கம் உருவாக்கப்பட்டுள்ளது
imported>Krinkle
Update from master using #Synchronizer
 
(பயனரால் செய்யப்பட்ட ஒரு இடைப்பட்ட திருத்தம் காட்டப்படவில்லை.)
வரிசை 332:
-- by replacing year with 1 - year if date.year <= 0).
-- options.era = { year<=0 , year>0 }
['BCMINUS'] = { 'கிமுBC' , '' , isbc = true, sign = MINUS },
['BCNEGATIVE'] = { 'கிமுBC' , '' , isbc = true, sign = '-' },
['BC'] = { 'கிமுBC' , '' , isbc = true },
['B.C.'] = { 'கிB.முC.' , '' , isbc = true },
['BCE'] = { 'கிமுBCE' , '' , isbc = true },
['B.C.E.'] = { 'கிB.முC.E.', '' , isbc = true },
['AD'] = { 'கிமுBC' , 'கிபிAD' },
['A.D.'] = { 'கிB.முC.' , 'கிA.பிD.' },
['CE'] = { 'கிமுBCE' , 'கி.பிCE' },
['C.E.'] = { 'கிB.முC.E.', 'கிC.பிE.' },
}
 
வரிசை 524:
local day_info = {
-- 0=Sun to 6=Sat
[0] = { 'ஞாயிறுSun', 'ஞாயிற்றுக்கிழமைSunday' },
{ 'Mon', 'Monday' },
{ 'திங்கள்', 'திங்கட்கிழமை' },
{ 'Tue', 'Tuesday' },
{ 'செவ்வாய்', 'செவ்வாய்க்கிழமை' },
{ 'புதன்Wed', 'புதன்கிழமைWednesday' },
{ 'Thu', 'Thursday' },
{ 'வியாழன்', 'வியாழக்கிழமை' },
{ 'Fri', 'Friday' },
{ 'வெள்ளி', 'வெள்ளிக்கிழமை' },
{ 'சனிSat', 'சனிக்கிழமைSaturday' },
}
 
local month_info = {
-- 1=Jan to 12=Dec
{ 'Jan', 'சனவரிJanuary' },
{ 'Feb', 'பிப்ரவரிFebruary' },
{ 'Mar', 'மார்ச்சுMarch' },
{ 'Apr', 'ஏப்ரல்April' },
{ 'May', 'மேMay' },
{ 'Jun', 'சூலைJune' },
{ 'Jul', 'சூலைJuly' },
{ 'Aug', 'ஆகத்துAugust' },
{ 'Sep', 'செப்டம்பர்September' },
{ 'Oct', 'அக்டோபர்October' },
{ 'Nov', 'நவம்பர்November' },
{ 'Dec', 'திசம்பர்December' },
}
 
வரிசை 554:
end
end
 
--[[local function day_number(text)
text=text:lower()
if (text=='sun' or text=='sunday' or text=='ஞாயிறு' or text=='ஞாயிற்றுக்கிழமை' or text=='ஞாயிற்றுக் கிழமை') then return 0
elseif (text=='mon' or text=='monday' or text=='திங்கள்' or text=='திங்கட்கிழமை' or text=='திங்கட் கிழமை') then return 1
elseif (text=='tue' or text=='tuesday' or text=='செவ்வாய்' or text=='செவ்வாய்க்கிழமை' or text=='செவ்வாய்க் கிழமை') then return 2
elseif (text=='wed' or text=='wednesday' or text=='புதன்' or text=='புதன்கிழமை' or text=='புதன் கிழமை') then return 3
elseif (text=='thu' or text=='thursday' or text=='வியாழன்' or text=='வியாழக்கிழமை' or text=='வியாழக் கிழமை') then return 4
elseif (text=='fri' or text=='friday' or text=='வெள்ளி' or text=='வெள்ளிக்கிழமை' or text=='வெள்ளிக் கிழமை') then return 5
elseif (text=='sat' or text=='saturday' or text=='சனி' or text=='சனிக்கிழமை' or text=='சனிக் கிழமை') then return 6
end
end--]]
 
local function day_number(text)
வரி 580 ⟶ 568:
 
local function month_number(text)
return name_to_number(text:gsub('%.', ''), {
jan = 1, january = 1,
feb = 2, february = 2,
வரி 707 ⟶ 695:
end
 
-- A table to getCache the current date/time (UTC), but only if needed.
--
local current = setmetatable({}, {
-- Note that os.date() returns an empty object with optimized lazy getters for each field.
__index = function (self, key)
-- Avoid current.min or current.sec in articles! https://phabricator.wikimedia.org/T416616
local d = os.date('!*t')
--
self.year = d.year
-- Beware that while os.date() uses 'min' and 'sec', our Date() uses 'minute' and 'second'.
self.month = d.month
local current = setmetatableos.date({}, {'!*t')
self.day = d.day
self.hour = d.hour
self.minute = d.min
self.second = d.sec
return rawget(self, key)
end })
 
local function extract_date(newdate, text)
வரி 919 ⟶ 902:
-- Return filled date1, date2 (two full dates).
local function filled(a, b)
-- Return date a filled, if necessary, with month and/or day from date b.
-- The filled day is truncated to fit the number of days in the month.
local fillmonth, fillday
if not a.month then
வரி 927 ⟶ 912:
end
if fillmonth or fillday then -- need to create a new date
a = Date(a, { month = fillmonth, day = fillday })
month = fillmonth,
day = math.min(fillday or a.day, days_in_month(a.year, fillmonth or a.month, a.calendar))
})
end
return a
வரி 1,302 ⟶ 1,290:
if argtype == 'currentdatetime' then
newdate.hour = current.hour
newdate.minute = current.minutemin
newdate.second = current.secondsec
newdate.hastime = true
end
வரி 1,408 ⟶ 1,396:
end
local H, M, S = diff.hours, diff.minutes, diff.seconds
if code == 'dh' or code == 'dhm' or code == 'dhms' or code == 'h' or code == 'hm' or code == 'hms' or code == 'M' or code == 's' then
local days = floor(diff.age_days + extra_days)
local inc_hour
வரி 1,423 ⟶ 1,411:
inc_hour = true
end
end
elseif code == 'M' then
if S >= 30 then
M = M + 1
end
else
வரி 1,449 ⟶ 1,441:
elseif code == 'hm' then
return hours, M
elseif code == 'M' or code == 's' then
M = hours * 60 + M
if code == 'M' then
return M
end
return M * 60 + S
end
return hours, M, S
"https://tamilar.wiki/w/Module:Date" இலிருந்து மீள்விக்கப்பட்டது