<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="he">
	<id>https://chabadpedia.co.il/index.php?action=history&amp;feed=atom&amp;title=%D7%99%D7%97%D7%99%D7%93%D7%94%3A%D7%98%D7%95%D7%95%D7%97_%D7%96%D7%9E%D7%A0%D7%99%D7%9D</id>
	<title>יחידה:טווח זמנים - היסטוריית גרסאות</title>
	<link rel="self" type="application/atom+xml" href="https://chabadpedia.co.il/index.php?action=history&amp;feed=atom&amp;title=%D7%99%D7%97%D7%99%D7%93%D7%94%3A%D7%98%D7%95%D7%95%D7%97_%D7%96%D7%9E%D7%A0%D7%99%D7%9D"/>
	<link rel="alternate" type="text/html" href="https://chabadpedia.co.il/index.php?title=%D7%99%D7%97%D7%99%D7%93%D7%94:%D7%98%D7%95%D7%95%D7%97_%D7%96%D7%9E%D7%A0%D7%99%D7%9D&amp;action=history"/>
	<updated>2026-04-12T05:02:49Z</updated>
	<subtitle>היסטוריית הגרסאות של הדף הזה בוויקי</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://chabadpedia.co.il/index.php?title=%D7%99%D7%97%D7%99%D7%93%D7%94:%D7%98%D7%95%D7%95%D7%97_%D7%96%D7%9E%D7%A0%D7%99%D7%9D&amp;diff=799158&amp;oldid=prev</id>
		<title>מ. רובין: יצירת דף עם התוכן &quot;local Date = require(&#039;Module:תאריך&#039;) local Arguments = require(&quot;Module:Arguments&quot;) local HebrewDate = require(&quot;Module:תאריך עברי&quot;)  local function convertDate(date)     local success, hebrewDate = pcall(HebrewDate.fromhebrew, mw.getCurrentFrame():newChild { args = { date } })     if success then         return hebrewDate     else         return date     end end  local function render(frame)     local args = Arguments.getArgs(frame, {         [...&quot;</title>
		<link rel="alternate" type="text/html" href="https://chabadpedia.co.il/index.php?title=%D7%99%D7%97%D7%99%D7%93%D7%94:%D7%98%D7%95%D7%95%D7%97_%D7%96%D7%9E%D7%A0%D7%99%D7%9D&amp;diff=799158&amp;oldid=prev"/>
		<updated>2025-08-28T16:40:49Z</updated>

		<summary type="html">&lt;p&gt;יצירת דף עם התוכן &amp;quot;local Date = require(&amp;#039;Module:תאריך&amp;#039;) local Arguments = require(&amp;quot;Module:Arguments&amp;quot;) local HebrewDate = require(&amp;quot;Module:תאריך עברי&amp;quot;)  local function convertDate(date)     local success, hebrewDate = pcall(HebrewDate.fromhebrew, mw.getCurrentFrame():newChild { args = { date } })     if success then         return hebrewDate     else         return date     end end  local function render(frame)     local args = Arguments.getArgs(frame, {         [...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;דף חדש&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local Date = require(&amp;#039;Module:תאריך&amp;#039;)&lt;br /&gt;
local Arguments = require(&amp;quot;Module:Arguments&amp;quot;)&lt;br /&gt;
local HebrewDate = require(&amp;quot;Module:תאריך עברי&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local function convertDate(date)&lt;br /&gt;
    local success, hebrewDate = pcall(HebrewDate.fromhebrew, mw.getCurrentFrame():newChild { args = { date } })&lt;br /&gt;
    if success then&lt;br /&gt;
        return hebrewDate&lt;br /&gt;
    else&lt;br /&gt;
        return date&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function render(frame)&lt;br /&gt;
    local args = Arguments.getArgs(frame, {&lt;br /&gt;
        [&amp;#039;trim&amp;#039;] = true,&lt;br /&gt;
        [&amp;#039;removeBlanks&amp;#039;] = true&lt;br /&gt;
    })&lt;br /&gt;
    local res = &amp;#039;&amp;#039;&lt;br /&gt;
    local dateFormat = &amp;#039;&amp;#039;&lt;br /&gt;
    local maintainceCategory = &amp;#039;&amp;#039;&lt;br /&gt;
    local entityId = args[&amp;#039;qid&amp;#039;]&lt;br /&gt;
    if (entityId == &amp;#039;-&amp;#039; or entityId == &amp;#039;&amp;#039;) then&lt;br /&gt;
        entityId = nil&lt;br /&gt;
    end&lt;br /&gt;
    local pointInTime = args[&amp;#039;נקודת זמן&amp;#039;]&lt;br /&gt;
    local startDate = args[&amp;#039;תאריך התחלה&amp;#039;]&lt;br /&gt;
    local endDate = args[&amp;#039;תאריך סיום&amp;#039;]&lt;br /&gt;
    local tempStart = startDate&lt;br /&gt;
    local tempEnd = endDate&lt;br /&gt;
&lt;br /&gt;
    if startDate then&lt;br /&gt;
        startDate = convertDate(startDate)&lt;br /&gt;
    end&lt;br /&gt;
    if endDate then&lt;br /&gt;
        endDate = convertDate(endDate)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local wikidataStartDate = args[&amp;#039;תאריך התחלה-ויקינתונים&amp;#039;] or &amp;#039;P580&amp;#039;&lt;br /&gt;
    local wikidataEndDate = args[&amp;#039;תאריך סיום-ויקינתונים&amp;#039;] or &amp;#039;P582&amp;#039;&lt;br /&gt;
    local wikidataEndDateLimit = args[&amp;#039;גבול תאריך סיום-ויקינתונים&amp;#039;]&lt;br /&gt;
    local showEditWikidata = true&lt;br /&gt;
&lt;br /&gt;
    -- text to show if we have only end date. Example: &amp;quot;Last even - %s&amp;quot; where %s is time. nil - will not show end date&lt;br /&gt;
    local onlyEndDateText = args[&amp;#039;טקסט סיום&amp;#039;]&lt;br /&gt;
    -- text to show if we have only start date. Example: &amp;quot;First even - %s&amp;quot; where %s is time. nil - will not show end date&lt;br /&gt;
    local onlyStartDateText = args[&amp;#039;טקסט התחלה&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
    local duration = args[&amp;#039;משך&amp;#039;] -- P2047&lt;br /&gt;
    -- Whether to show time diff between start and end day when applicable. Example: כן.&lt;br /&gt;
    local showTimeDiff = args[&amp;#039;הצגת הפרשת זמנים&amp;#039;]&lt;br /&gt;
    local dateRangeDiffFormat = args[&amp;#039;פורמט הצגה&amp;#039;] or &amp;#039;%s (%s)&amp;#039;&lt;br /&gt;
&lt;br /&gt;
    local usingWikidata = false&lt;br /&gt;
&lt;br /&gt;
    -- Whether the event still continues. this will show &amp;lt;START&amp;gt;-present. Example: כן&lt;br /&gt;
    local defaultOngoingEvent = args[&amp;#039;נמשך&amp;#039;] == &amp;#039;כן&amp;#039;&lt;br /&gt;
    local ongoingEvent = defaultOngoingEvent&lt;br /&gt;
    local endDateOngoingEvent = args[&amp;#039;הווה&amp;#039;]&lt;br /&gt;
    local presentText = args[&amp;#039;טקסט הווה&amp;#039;]&lt;br /&gt;
    local diffFormat = &amp;#039;auto&amp;#039; -- TODO: better handling for different scales&lt;br /&gt;
&lt;br /&gt;
    if endDate ~= nil and endDate ~= &amp;#039;&amp;#039; then&lt;br /&gt;
        if endDateOngoingEvent ~= nil then&lt;br /&gt;
            -- set default ongoingEvent as false&lt;br /&gt;
            ongoingEvent = false&lt;br /&gt;
            for v in string.gmatch(endDateOngoingEvent, &amp;quot;[^,]+&amp;quot;) do&lt;br /&gt;
                if v:match(&amp;#039;^%s*(.-)%s*$&amp;#039;) == endDate then&lt;br /&gt;
                    -- set as true if end date specific that match endDateOngoingEvent&lt;br /&gt;
                    ongoingEvent = true&lt;br /&gt;
                    if presentText then&lt;br /&gt;
                        endDate = presentText&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            -- explicity end date was specified, hence it is not ongoing&lt;br /&gt;
            ongoingEvent = false&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- simple case of single point in time&lt;br /&gt;
    if pointInTime ~= nil or startDate == endDate then&lt;br /&gt;
        if pointInTime == nil and startDate == endDate then&lt;br /&gt;
            pointInTime = startDate&lt;br /&gt;
        end&lt;br /&gt;
        res = pointInTime&lt;br /&gt;
    else -- date ranges&lt;br /&gt;
        if startDate == nil and endDate ~= nil then&lt;br /&gt;
            if onlyEndDateText == nil then&lt;br /&gt;
                dateFormat = &amp;#039;%s–%s&amp;#039;&lt;br /&gt;
                if mw.ustring.match(endDate, &amp;#039; &amp;#039;) then&lt;br /&gt;
                    dateFormat = &amp;#039;%s – %s&amp;#039;&lt;br /&gt;
                end&lt;br /&gt;
                res = mw.ustring.format(dateFormat, &amp;#039;?&amp;#039;, tempEnd)&lt;br /&gt;
            else&lt;br /&gt;
                res = mw.ustring.format(onlyEndDateText, tempEnd)&lt;br /&gt;
            end&lt;br /&gt;
        elseif startDate ~= nil and (endDate == nil or (ongoingEvent and endDate ~= nil)) then&lt;br /&gt;
            if onlyStartDateText then&lt;br /&gt;
                -- in corner cases where the start date is actually more complex text, avoid wrapping it&lt;br /&gt;
                if mw.ustring.match(startDate, &amp;#039;.+\n.+&amp;#039;) or mw.ustring.find(startDate, &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;) ~= nil or&lt;br /&gt;
                    mw.ustring.match(startDate, &amp;#039;.+[•,].+&amp;#039;) ~= nil then&lt;br /&gt;
                    res = startDate&lt;br /&gt;
                else&lt;br /&gt;
                    res = mw.ustring.format(onlyStartDateText, tempStart)&lt;br /&gt;
                end&lt;br /&gt;
            else&lt;br /&gt;
                if ongoingEvent then&lt;br /&gt;
                    dateFormat = &amp;#039;%s–%s&amp;#039;&lt;br /&gt;
                    if mw.ustring.match(startDate, &amp;#039; &amp;#039;) or (endDate and mw.ustring.match(endDate, &amp;#039; &amp;#039;)) then&lt;br /&gt;
                        dateFormat = &amp;#039;%s – %s&amp;#039;&lt;br /&gt;
                    end&lt;br /&gt;
                    res = mw.ustring.format(dateFormat, startDate, endDate or &amp;#039;הווה&amp;#039;)&lt;br /&gt;
                    -- try to fallback to automatic duration if duration is not available&lt;br /&gt;
                    if showTimeDiff == &amp;#039;כן&amp;#039; and duration == nil then&lt;br /&gt;
                        local success, automaicDuration = pcall(Date.parseDateRange, startDate, diffFormat, true)&lt;br /&gt;
                        if success then&lt;br /&gt;
                            duration = automaicDuration&lt;br /&gt;
                        end&lt;br /&gt;
                    end&lt;br /&gt;
                    res = mw.ustring.format(dateFormat, tempStart, tempEnd or &amp;#039;הווה&amp;#039;)&lt;br /&gt;
                else&lt;br /&gt;
                    res = startDate&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        elseif startDate ~= nil and endDate ~= nil then&lt;br /&gt;
            dateFormat = &amp;#039;%s–%s&amp;#039;&lt;br /&gt;
            if mw.ustring.match(startDate, &amp;#039; &amp;#039;) or mw.ustring.match(endDate, &amp;#039; &amp;#039;) then&lt;br /&gt;
                dateFormat = &amp;#039;%s – %s&amp;#039;&lt;br /&gt;
            end&lt;br /&gt;
            res = mw.ustring.format(dateFormat, startDate, endDate)&lt;br /&gt;
            if showTimeDiff == &amp;#039;כן&amp;#039; and duration == nil then&lt;br /&gt;
                local success, automaicDuration = pcall(Date.parseDateRange, res, diffFormat, true)&lt;br /&gt;
                if success then&lt;br /&gt;
                    duration = automaicDuration&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
            res = mw.ustring.format(dateFormat, tempStart, tempEnd)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- append the duration&lt;br /&gt;
    if showTimeDiff == &amp;#039;כן&amp;#039; and duration ~= nil and duration ~= &amp;#039;&amp;#039; and res ~= nil then&lt;br /&gt;
        res = mw.ustring.format(dateRangeDiffFormat, res, duration)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if showEditWikidata and usingWikidata and res ~= nil and res ~= &amp;#039;&amp;#039; and entityId ~= nil then&lt;br /&gt;
        local link = mw.title.makeTitle(0, entityId, &amp;#039;&amp;#039;, &amp;#039;wikidata&amp;#039;):fullUrl(&amp;#039;uselang=he&amp;#039;)&lt;br /&gt;
        res = res ..&lt;br /&gt;
            mw.ustring&lt;br /&gt;
            .format(&lt;br /&gt;
                &amp;#039; [[File:Blue pencil RTL.svg|15px|link=%s|עריכת הנתון בוויקינתונים]]&amp;#039;, link)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if maintainceCategory ~= nil and res ~= nil then&lt;br /&gt;
        res = res .. maintainceCategory&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return res&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
    [&amp;#039;טווח זמנים&amp;#039;] = render&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>מ. רובין</name></author>
	</entry>
</feed>