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'] = { '
['BCNEGATIVE'] = { '
['BC'] = { '
['B.C.'] = { '
['BCE'] = { '
['B.C.E.'] = { '
['AD'] = { '
['A.D.'] = { '
['CE'] = { '
['C.E.'] = { '
}
வரிசை 524:
local day_info = {
-- 0=Sun to 6=Sat
[0] = { '
{ 'Mon', 'Monday' },
{ 'Tue', 'Tuesday' },
{ '
{ 'Thu', 'Thursday' },
{ 'Fri', 'Friday' },
{ '
}
local month_info = {
-- 1=Jan to 12=Dec
{ 'Jan', '
{ 'Feb', '
{ 'Mar', '
{ 'Apr', '
{ 'May', '
{ 'Jun', '
{ 'Jul', '
{ 'Aug', '
{ 'Sep', '
{ 'Oct', '
{ 'Nov', '
{ 'Dec', '
}
வரிசை 554:
end
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
--
--
local current = setmetatable({}, {▼
-- Note that os.date() returns an empty object with optimized lazy getters for each field.
-- Avoid current.min or current.sec in articles! https://phabricator.wikimedia.org/T416616
--
-- Beware that while os.date() uses 'min' and 'sec', our Date() uses 'minute' and 'second'.
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 = 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.
newdate.second = current.
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
| |||