Anonymous committed a5cd64e

News dates are real dates.

Comments (0)

Files changed (2)

 News template, with news items inline, sorted by date, and
 with anchors, that the links in the feed match up with.
-News archive.  (Could be the News Item index, sorted by date.)
-News dates should be real date objects, so we can sort by them.
+News page: same as the News Item index, but sorted by date.
 Render images.  (LED-386, Mildred, games...)


 # encoding: UTF-8
+from datetime import datetime
 import re
               assert node['inception-date'] != 'Unknown'
               node['inception-date'] = ApproximateDate(str(node['inception-date']))
       except Exception:
-          print "'%s' has bad date '%s'" % (key, node['inception-date'])
+          print "'%s' has bad inception-date '%s'" % (key, node['inception-date'])
+          raise
+      try:
+          if 'news-date' in node:
+              assert node['news-date'] != 'Unknown'
+              node['news-date'] = datetime.strptime(
+                  str(node['news-date']), '%a, %d %b %Y %H:%M:%S GMT'
+              )
+      except Exception:
+          print "'%s' has bad news-date '%s'" % (key, node['news-date'])
       check_optional_scalar_ref(data, key, node, 'domain')
       check_optional_list_ref(data, key, node, 'see-also')