<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ADate_period</id>
	<title>Module:Date period - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ADate_period"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Date_period&amp;action=history"/>
	<updated>2026-06-14T18:32:11Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://mywikibiz.com/index.php?title=Module:Date_period&amp;diff=471491&amp;oldid=prev</id>
		<title>Zoran: Pywikibot 6.4.0</title>
		<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Date_period&amp;diff=471491&amp;oldid=prev"/>
		<updated>2021-07-15T21:17:03Z</updated>

		<summary type="html">&lt;p&gt;Pywikibot 6.4.0&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local Date = require('Module:Date')._Date&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	return p._main(frame.args[1], frame.args[2], frame.args['force-year'])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(_dateA, _dateB, showYear)&lt;br /&gt;
	if _dateA == nil and _dateB == nil then&lt;br /&gt;
		error('Date A or B not provided.')&lt;br /&gt;
	elseif _dateA == nil then&lt;br /&gt;
		return Date(_dateA):text('%B %-d')&lt;br /&gt;
	elseif _dateB == nil then&lt;br /&gt;
		return Date(_dateB):text('%B %-d')&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local dateA = Date(_dateA)&lt;br /&gt;
	local dateB = Date(_dateB)&lt;br /&gt;
	&lt;br /&gt;
	if dateA == nil and dateB == nil then&lt;br /&gt;
		error(&amp;quot;Either date A, date B, or both dates must be valid.&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Handles nil dateA or dateB, but not nil both.&lt;br /&gt;
	local showYear = (yesno(showYear)) or (dateA or dateB).year ~= (dateB or dateA).year&lt;br /&gt;
	&lt;br /&gt;
	-- Handle cases where one of the dates is not a valid date.&lt;br /&gt;
	if dateA == nil and dateB ~= nil then&lt;br /&gt;
		return _dateA .. ' – ' .. dateB:text('%B %-d') .. (showYear and (', ' .. dateB.year) or '')&lt;br /&gt;
	elseif dateB == nil and dateA ~= nil then&lt;br /&gt;
		return dateA:text('%B %-d') .. (showYear and (', ' .. dateA.year) or '') .. ' – ' .. _dateB&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if dateA.year == dateB.year then&lt;br /&gt;
		if dateA.month == dateB.month and dateA.day == dateB.day then&lt;br /&gt;
			return dateA:text('%B %-d')&lt;br /&gt;
		elseif dateA.month == dateB.month then&lt;br /&gt;
			return dateA:text('%B %-d') .. ' – ' .. dateB.day .. (showYear and (', ' .. dateA.year) or '')&lt;br /&gt;
		else&lt;br /&gt;
			return dateA:text('%B %-d') .. ' – ' .. dateB:text('%B %-d') .. (showYear and (', ' .. dateA.year) or '')&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return dateA:text('%B %-d, %-Y') .. ' – ' .. dateB:text('%B %-d, %-Y')&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>