עריכת הדף "יחידה:תאריך"

קפיצה לניווט קפיצה לחיפוש
אזהרה: אינכם מחוברים לחשבון. כתובת ה־IP שלכם תוצג בפומבי אם תבצעו עריכות כלשהן. אם תיכנסו לחשבון או תיצרו חשבון, העריכות שלכם תיוחסנה לשם המשתמש שלכם ותקבלו גם יתרונות אחרים.

ניתן לבטל את העריכה. נא לבדוק את השוואת הגרסאות שלהלן כדי לוודא שזה אכן מה שאתם רוצים לעשות, ולאחר מכן לפרסם את השינויים למטה כדי לסיים את ביטול העריכה.

גרסה אחרונה הטקסט שלך
שורה 164: שורה 164:
     end
     end


     --offset
     --ofset
     if offset ~= nil then
     if offset ~= nil then
         if offset == 'Z' then
         if offset == 'Z' then
שורה 806: שורה 806:
    
    
local outputPrefix = ''
local outputPrefix = ''
local parts = mw.text.split(dateRangeStr,' *[–%-] *')
local parts = mw.text.split(dateRangeStr,' +%- +')
assert(#parts==2 or #parts==1, "Date range expected format is from - to or from (e.g from - now)")
assert(#parts==2 or #parts==1, "Date range expected format is from - to or from (e.g from - now)")
שורה 899: שורה 899:
return dif
return dif
else
else
local res =  outputPrefix..lang:formatDuration(dif, diffFormat)
return outputPrefix..lang:formatDuration(dif, diffFormat)
-- post process formatDuration which is not good enough
res= mw.ustring.gsub(res,"כ־([א-ת])","כ%1")
res= mw.ustring.gsub(res,"וגם ([0-9])","ו־%1")
res= mw.ustring.gsub(res,"וגם ([א-ת])","ו%1")
return res
end
end
end
end
שורה 929: שורה 924:
-- the following translations are needed because the underline function
-- the following translations are needed because the underline function
-- local format is wierd
-- local format is wierd
str = mw.ustring.gsub(str, "(כ)־([א-ת])", "%1%2")
str = mw.ustring.gsub(str,  
"(כ)־([א-ת])", "%1%2")
str= mw.ustring.gsub(str,"וגם ([0-9])","ו-%1")
str= mw.ustring.gsub(str,"וגם ([א-ת])","ו%1");


if frame.args[2] == "גיל" then
if frame.args[2] == "גיל" then
שורה 980: שורה 978:


end
end
end
function linkStrDateUnsafe(frame)
local dateStr = frame.args[1]
local linkedDateStr = dateStr
-- Strip [ and ] chars
linkedDateStr = mw.ustring.gsub(linkedDateStr, '%[', '')
linkedDateStr = mw.ustring.gsub(linkedDateStr, '%]', '')
-- Link D M Y, return [[D M]] [[Y]]
linkedDateStr = mw.ustring.gsub(linkedDateStr, '^(%d+ %a+) (%d+)$', '[[%1]] [[%2]]')
-- Link D M, return [[D M]]
if mw.ustring.find(linkedDateStr, '%[') == nil then
linkedDateStr = mw.ustring.gsub(linkedDateStr, '^(%d+) (%a+)$', '[[%1 %2]]')
end
-- Link M Y, return [[M]] [[Y]]
if mw.ustring.find(linkedDateStr, '%[') == nil then
linkedDateStr = mw.ustring.gsub(linkedDateStr, '^(%a+) (%d+)$', '[[%1]] [[%2]]')
end
-- Link Y, return [[Y]]
if mw.ustring.find(linkedDateStr, '%[') == nil then
linkedDateStr = mw.ustring.gsub(linkedDateStr, '^(%d+)$', '[[%1]]')
end
-- Unknown date string format, return the original string
if mw.ustring.find(linkedDateStr, '%[') == nil then
linkedDateStr = dateStr
end
return linkedDateStr
end
end


שורה 1,012: שורה 983:
Date['חשב טווח'] =  parseDateRangeSafe;
Date['חשב טווח'] =  parseDateRangeSafe;
Date['parseDateRange'] =  parseDateRange;
Date['parseDateRange'] =  parseDateRange;
Date['מקושר'] = linkStrDateUnsafe;


return Date
return Date
לתשומת ליבך: תרומתך לאתר חב"דפדיה תפורסם לפי תנאי הרישיון GNU Free Documentation License 1.2 (אפשר לעיין בדף חב"דפדיה:זכויות יוצרים לפרטים נוספים). אם אינך רוצה שעבודתך תהיה זמינה לעריכה על־ידי אחרים, שתופץ לעיני כול, ושאחרים יוכלו להעתיק ממנה תוך ציון המקור – אין לפרסם אותה פה.
כמו־כן, שמירת העריכה משמעה הבטחה שכתבת את הטקסט הזה בעצמך או העתקת אותו ממקור בנחלת הכלל (שאינו מוגבל בזכויות יוצרים) או מקור חופשי דומה. אין לשלוח חומר מוגבל בזכויות יוצרים ללא רשות!
ביטול עזרה בעריכה (נפתח בחלון חדש)