<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://ru.ru-skazki.ru/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3ANextPrev</id>
	<title>Модуль:NextPrev - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://ru.ru-skazki.ru/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3ANextPrev"/>
	<link rel="alternate" type="text/html" href="http://ru.ru-skazki.ru/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:NextPrev&amp;action=history"/>
	<updated>2026-05-07T23:30:49Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>http://ru.ru-skazki.ru/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:NextPrev&amp;diff=4339&amp;oldid=prev</id>
		<title>Импортёр: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://ru.ru-skazki.ru/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:NextPrev&amp;diff=4339&amp;oldid=prev"/>
		<updated>2024-05-01T09:53:40Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 12:53, 1 мая 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Импортёр</name></author>
	</entry>
	<entry>
		<id>http://ru.ru-skazki.ru/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:NextPrev&amp;diff=4338&amp;oldid=prev</id>
		<title>ru&gt;Andras в 21:30, 24 июня 2023</title>
		<link rel="alternate" type="text/html" href="http://ru.ru-skazki.ru/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:NextPrev&amp;diff=4338&amp;oldid=prev"/>
		<updated>2023-06-24T21:30:13Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Module that should replace {{NextPrev}}&lt;br /&gt;
local p = {}&lt;br /&gt;
--local mw_time = mw.getContentLanguage():formatDate()&lt;br /&gt;
&lt;br /&gt;
local yyyymmdd = require(&amp;#039;Module:Dates&amp;#039;).yyyymmdd&lt;br /&gt;
-- parses date&lt;br /&gt;
-- if it is: &amp;quot;7 ноября 2021&amp;quot; then transforms to yyyy-mm-dd&lt;br /&gt;
-- if it matches &amp;quot;^%s*%d+\-%d+\-%d+&amp;quot; which means format &amp;quot;*-*-*&amp;quot; where the order could be different but it ASSUMES that it is yyyy-mm-dd then does nothing&lt;br /&gt;
&lt;br /&gt;
local Date = require(&amp;#039;Module:Date&amp;#039;)._Date&lt;br /&gt;
--?&lt;br /&gt;
&lt;br /&gt;
-- date is Date object from Module:Date&lt;br /&gt;
local function prev_date(frame, parent_page, date, format)&lt;br /&gt;
	if(date == nil or date == &amp;#039;&amp;#039;) then&lt;br /&gt;
		return &amp;quot;|&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local prev_title = nil&lt;br /&gt;
	for i = 1, 20 do&lt;br /&gt;
		local check_date = date-string.format(&amp;#039;%dd&amp;#039;,i) --expected to subtract something like &amp;#039;3d&amp;#039;&lt;br /&gt;
		local title = mw.title.new(parent_page..&amp;#039;/&amp;#039;..frame:callParserFunction(&amp;#039;#time&amp;#039;, format, check_date:text(), &amp;#039;ru&amp;#039;))&lt;br /&gt;
		if (title.exists) then --expensive call&lt;br /&gt;
			prev_title = title&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return prev_title&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- date is Date object from Module:Date&lt;br /&gt;
local function next_date(frame, parent_page, date, format)&lt;br /&gt;
	if(date == nil or date == &amp;#039;&amp;#039;) then&lt;br /&gt;
		return &amp;quot;|&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local next_title = nil&lt;br /&gt;
	for i = 1, 20 do&lt;br /&gt;
		local check_date = date+string.format(&amp;#039;%dd&amp;#039;,i) --expected to subtract something like &amp;#039;3d&amp;#039;&lt;br /&gt;
		local title = mw.title.new(parent_page..&amp;#039;/&amp;#039;..frame:callParserFunction(&amp;#039;#time&amp;#039;, format, check_date:text(), &amp;#039;ru&amp;#039;))&lt;br /&gt;
		if (title.exists) then --expensive call&lt;br /&gt;
			next_title = title&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return next_title&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- next_prev seeks for previous and next non-empty page of discussion&lt;br /&gt;
-- the input date is supposed to be in format 22_октября_2021, alternatively an optional parameter f can contain format&lt;br /&gt;
-- the input date is supposed to be extracted from SUBPAGENAME but is not guaranteed to happen so&lt;br /&gt;
-- parent_page needs to include namespace like &amp;quot;РуСказки:К удалению&amp;quot;&lt;br /&gt;
function p.next_prev(frame)&lt;br /&gt;
	local parent_page = frame.args[1] or frame.args[&amp;#039;parent_page&amp;#039;]   -- no default value here&lt;br /&gt;
	local input_date  = frame.args[2] or frame.args[&amp;#039;raw_date&amp;#039;]      -- no default value here&lt;br /&gt;
	if(input_date == nil or input_date == &amp;#039;&amp;#039;) then&lt;br /&gt;
		return &amp;quot;|&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local format      = frame.args[3] or frame.args[&amp;#039;f&amp;#039;] or &amp;#039;j xg Y&amp;#039; -- default format &amp;#039;j xg Y&amp;#039;&lt;br /&gt;
	if (format==&amp;#039;&amp;#039;) then&lt;br /&gt;
		format = &amp;#039;j xg Y&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	-- Get the date we are considering from text representation&lt;br /&gt;
	local current_page_date = yyyymmdd({args = {input_date}}) -- yyyymmdd accepts not a date, but a frame, so we artificially envelop&lt;br /&gt;
	local current_page_date_object = Date(current_page_date)&lt;br /&gt;
	&lt;br /&gt;
	-- Find the previous and next page that exist&lt;br /&gt;
	local prev_title = prev_date(frame,parent_page,current_page_date_object, format)&lt;br /&gt;
	local next_title = next_date(frame,parent_page,current_page_date_object, format)&lt;br /&gt;
	&lt;br /&gt;
	-- If the pages were found, form navigation buttons&lt;br /&gt;
	local str = &amp;quot;&amp;quot;&lt;br /&gt;
	if (prev_title ~= nil and prev_title.fullText ~= nil) then&lt;br /&gt;
		str = str..string.format(&amp;#039;[[%s|&amp;lt;&amp;lt;]]&amp;#039;, prev_title.fullText)&lt;br /&gt;
	end&lt;br /&gt;
	str = str..&amp;quot;&amp;amp;nbsp;|&amp;amp;nbsp;&amp;quot;&lt;br /&gt;
	if (next_title ~= nil and next_title.fullText ~= nil) then&lt;br /&gt;
		str = str..string.format(&amp;#039;[[%s|&amp;gt;&amp;gt;]]&amp;#039;, next_title.fullText)&lt;br /&gt;
	end&lt;br /&gt;
	return str&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This version of prev_date includes convertation of raw_date into Date object&lt;br /&gt;
-- the argument is a frame meant to be used with #invoke:NextPrev|prev_date|parent_page=|raw_date=&lt;br /&gt;
function p.prev_date(frame)&lt;br /&gt;
	local parent_page = frame.args[&amp;#039;parent_page&amp;#039;]&lt;br /&gt;
	local current_page_date = yyyymmdd({args = {frame.args[&amp;#039;raw_date&amp;#039;]}})&lt;br /&gt;
	local date = Date(current_page_date)&lt;br /&gt;
	local format = frame.args[&amp;#039;f&amp;#039;] or &amp;#039;j xg Y&amp;#039;&lt;br /&gt;
	return prev_date(frame, parent_page, date, format)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This version of next_date includes convertation of raw_date into Date object&lt;br /&gt;
-- the argument is a frame meant to be used with #invoke:NextPrev|next_date|parent_page=|raw_date=&lt;br /&gt;
function p.next_date(frame)&lt;br /&gt;
	local parent_page = frame.args[&amp;#039;parent_page&amp;#039;]&lt;br /&gt;
	local current_page_date = yyyymmdd({args = {frame.args[&amp;#039;raw_date&amp;#039;]}})&lt;br /&gt;
	local date = Date(current_page_date)&lt;br /&gt;
	local format = frame.args[&amp;#039;f&amp;#039;] or &amp;#039;j xg Y&amp;#039;&lt;br /&gt;
	return next_date(frame, parent_page, date, format)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>ru&gt;Andras</name></author>
	</entry>
</feed>