1.1 --- a/DateSupport.py Fri Dec 20 23:25:44 2013 +0100
1.2 +++ b/DateSupport.py Thu Jan 09 22:56:28 2014 +0100
1.3 @@ -2,7 +2,7 @@
1.4 """
1.5 MoinMoin - DateSupport library (derived from EventAggregatorSupport)
1.6
1.7 - @copyright: 2008, 2009, 2010, 2011, 2012, 2013 by Paul Boddie <paul@boddie.org.uk>
1.8 + @copyright: 2008, 2009, 2010, 2011, 2012, 2013, 2014 by Paul Boddie <paul@boddie.org.uk>
1.9 @license: GNU GPL (v2 or later), see COPYING.txt for details.
1.10 """
1.11
1.12 @@ -392,7 +392,7 @@
1.13 def __str__(self):
1.14 return Date.__str__(self) + self.time_string()
1.15
1.16 - def time_string(self, zone_as_offset=False, time_prefix=" ", zone_prefix=" "):
1.17 + def time_string(self, zone_as_offset=False, time_prefix=" ", zone_prefix=" ", zone_separator=":"):
1.18 if self.has_time():
1.19 data = self.as_tuple()
1.20 time_str = "%s%02d:%02d" % ((time_prefix,) + data[3:5])
1.21 @@ -402,13 +402,23 @@
1.22 if zone_as_offset:
1.23 utc_offset = self.utc_offset()
1.24 if utc_offset:
1.25 - time_str += "%s%+03d:%02d" % ((zone_prefix,) + utc_offset)
1.26 + time_str += "%s%+03d%s%02d" % (zone_prefix, utc_offset[0], zone_separator, utc_offset[1])
1.27 else:
1.28 time_str += "%s%s" % (zone_prefix, data[6])
1.29 return time_str
1.30 else:
1.31 return ""
1.32
1.33 + def as_RFC2822_datetime_string(self):
1.34 + weekday = calendar.weekday(*self.data[:3])
1.35 + return "%s, %02d %s %04d %s" % (
1.36 + getDayLabel(weekday)[:3],
1.37 + self.data[2],
1.38 + getMonthLabel(self.data[1])[:3],
1.39 + self.data[0],
1.40 + self.time_string(zone_as_offset=True, time_prefix="", zone_prefix=" ", zone_separator="")
1.41 + )
1.42 +
1.43 def as_HTTP_datetime_string(self):
1.44 weekday = calendar.weekday(*self.data[:3])
1.45 return "%s, %02d %s %04d %02d:%02d:%02d GMT" % ((
2.1 --- a/README.txt Fri Dec 20 23:25:44 2013 +0100
2.2 +++ b/README.txt Thu Jan 09 22:56:28 2014 +0100
2.3 @@ -71,6 +71,7 @@
2.4 * Added groupHasMember from ApproveChanges.
2.5 * Added the TokenSupport module to try and have a reliable shell-like
2.6 tokeniser.
2.7 + * Added RFC 2822 datetime formatting.
2.8
2.9 New in MoinSupport 0.4.1 (Changes since MoinSupport 0.4)
2.10 --------------------------------------------------------