Изменения

Перейти к навигации Перейти к поиску
работающий вариант
Строка 486: Строка 486:  
end
 
end
   −
-- =p.unitime(mw.getCurrentFrame():newChild{title="smth",args={"+1:30","1"}})
+
-- =p.unitime(mw.getCurrentFrame():newChild{title="smth",args={"−1:30","1"}})
    
function p.unitime( frame )
 
function p.unitime( frame )
Строка 500: Строка 500:  
     elseif (string.sub(input:upper(),1,3) == 'UTC') and (string.len(input) < 10) then
 
     elseif (string.sub(input:upper(),1,3) == 'UTC') and (string.len(input) < 10) then
 
     utcin = string.sub(input,4)
 
     utcin = string.sub(input,4)
     elseif string.sub(input,1,3) ~= "−" then utcin = input
+
     else
    elseif string.sub(input,1,1) == '['  
+
    if string.sub(input,1,1) == '['
    or string.sub(input,1,1) == '{' then
+
        or string.sub(input,1,1) == '{' then
--  or not (not input:find("[\192-\255]")) при наличии в строке юникода не работает
+
        return input
    return input
+
--      elseif not string.find(string.upper(string.sub(input,1,1)),"[\65-\90]") or
    else utcin = input end
+
--      not string.find(string.upper(string.sub(input,1,1)),"[\192-\223]") then
 +
--    return input
 +
    else utcin = input end
 +
    end
 +
--  elseif string.sub(input,1,3) ~= "−" then utcin = input
 +
--  or not (not input:find("[А-я]")) при наличии в строке юникода не работает
 
     local output = ""
 
     local output = ""
 
     if DST == 0 then output = utc(utcin)
 
     if DST == 0 then output = utc(utcin)
Анонимный участник

Реклама:

Навигация