← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:more-datetime-hover-text into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:more-datetime-hover-text into launchpad:master.

Commit message:
Show hover text more consistently on datetimes

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/401831

Many places in Launchpad's UI showed approximate/display dates with the exact timestamp in a tooltip, but this was quite inconsistent.  I added a couple more formatting helpers to encapsulate the common pattern for this, and arranged to use them in all the places where we previously showed only the approximate/display date and where the underlying datetime refers to an exact timestamp rather than an estimate.

A few tests required small adjustments to query counts, since the tooltips show timestamps in the user's local time if possible, and that requires a `PersonLocation` query.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:more-datetime-hover-text into launchpad:master.
diff --git a/lib/lp/answers/templates/question-history.pt b/lib/lp/answers/templates/question-history.pt
index a368a24..d2ea4cb 100644
--- a/lib/lp/answers/templates/question-history.pt
+++ b/lib/lp/answers/templates/question-history.pt
@@ -27,11 +27,8 @@
     <tbody>
       <tr tal:repeat="message context/messages">
         <td>
-          <span
-            tal:attributes="title message/datecreated/fmt:datetime"
-            tal:content="message/datecreated/fmt:approximatedate">
-            2005-10-16
-          </span>
+          <tal:created
+            replace="structure message/datecreated/fmt:approximatedatetitle" />
         </td>
         <td><a tal:replace="structure message/owner/fmt:link">Foo Bar</a></td>
         <td tal:content="message/action/title">Comment</td>
diff --git a/lib/lp/answers/templates/question-listing-detailed.pt b/lib/lp/answers/templates/question-listing-detailed.pt
index 8e56b20..a8368f2 100644
--- a/lib/lp/answers/templates/question-listing-detailed.pt
+++ b/lib/lp/answers/templates/question-listing-detailed.pt
@@ -9,9 +9,7 @@
       (<span tal:replace="context/status/title">Approved</span>)
     <br />
     <span class="registered">posted
-      <span
-        tal:attributes="title context/datecreated/fmt:datetime"
-        tal:replace="context/datecreated/fmt:displaydate">2005-10-05</span>
+      <tal:created replace="structure context/datecreated/fmt:displaydatetitle" />
       in
       <span tal:replace="context/target/title">SmegConf</span>
     </span>
diff --git a/lib/lp/answers/templates/question-listing.pt b/lib/lp/answers/templates/question-listing.pt
index 14afba6..de7aeec 100644
--- a/lib/lp/answers/templates/question-listing.pt
+++ b/lib/lp/answers/templates/question-listing.pt
@@ -143,11 +143,8 @@
           <td>
             <span class="sortkey"
               tal:content="question/datecreated/fmt:datetime" />
-            <span
-              tal:attributes="title question/datecreated/fmt:datetime"
-              tal:content="question/datecreated/fmt:approximatedate">
-              2006-07-17
-            </span>
+            <tal:created
+              replace="structure question/datecreated/fmt:approximatedatetitle" />
           </td>
           <td><a tal:replace="structure question/owner/fmt:link">Foo Bar</a></td>
           <td class="question-target"
diff --git a/lib/lp/answers/templates/question-portlet-details.pt b/lib/lp/answers/templates/question-portlet-details.pt
index 4270696..b63a3ea 100644
--- a/lib/lp/answers/templates/question-portlet-details.pt
+++ b/lib/lp/answers/templates/question-portlet-details.pt
@@ -62,27 +62,24 @@
     <dl tal:condition="context/answerer">
       <dt>Solved:</dt>
       <dd>
-        <span
-          tal:attributes="title context/date_solved/fmt:datetime"
-          tal:content="context/date_solved/fmt:approximatedate" />
+        <tal:solved
+          replace="structure context/date_solved/fmt:approximatedatetitle" />
       </dd>
     </dl>
 
     <dl style="clear: both;">
       <dt>Last query:</dt>
       <dd>
-        <span
-          tal:attributes="title context/datelastquery/fmt:datetime"
-          tal:content="context/datelastquery/fmt:approximatedate" />
+        <tal:last-query
+          replace="structure context/datelastquery/fmt:approximatedatetitle" />
       </dd>
     </dl>
 
     <dl>
       <dt>Last reply:</dt>
       <dd>
-        <span
-          tal:attributes="title context/datelastresponse/fmt:datetime"
-          tal:content="context/datelastresponse/fmt:approximatedate" />
+        <tal:last-response
+          replace="structure context/datelastresponse/fmt:approximatedatetitle" />
       </dd>
     </dl>
   </div>
diff --git a/lib/lp/answers/templates/question-portlet-reopenings.pt b/lib/lp/answers/templates/question-portlet-reopenings.pt
index ad459ec..883504e 100644
--- a/lib/lp/answers/templates/question-portlet-reopenings.pt
+++ b/lib/lp/answers/templates/question-portlet-reopenings.pt
@@ -9,11 +9,9 @@
 
     <ul>
       <li tal:repeat="reop context/reopenings">
-        <span
-          tal:attributes="title reop/datecreated/fmt:datetime"
-          tal:content="reop/datecreated/fmt:approximatedate">
-          2005-10-05
-        </span> by
+        <tal:created
+          replace="structure reop/datecreated/fmt:approximatedatetitle" />
+        by
         <a tal:replace="structure reop/reopener/fmt:link">Foo Bar</a>
       </li>
     </ul>
diff --git a/lib/lp/answers/templates/questiontarget-portlet-latestquestions.pt b/lib/lp/answers/templates/questiontarget-portlet-latestquestions.pt
index 916cc82..8ce08c6 100644
--- a/lib/lp/answers/templates/questiontarget-portlet-latestquestions.pt
+++ b/lib/lp/answers/templates/questiontarget-portlet-latestquestions.pt
@@ -16,7 +16,9 @@
                         href question/fmt:url;"
         tal:content="question/title/fmt:shorten/80">question title</a>
       <br /><span class="registered">
-        Posted <tal:when replace="question/datecreated/fmt:displaydate" />
+        Posted
+        <tal:when
+          replace="structure question/datecreated/fmt:displaydatetitle" />
       </span>
     </li>
   </ul>
diff --git a/lib/lp/app/browser/tales.py b/lib/lp/app/browser/tales.py
index 3020b39..17fd33f 100644
--- a/lib/lp/app/browser/tales.py
+++ b/lib/lp/app/browser/tales.py
@@ -505,11 +505,13 @@ class NoneFormatter:
 
     allowed_names = set([
         'approximatedate',
+        'approximatedatetitle',
         'approximateduration',
         'break-long-words',
         'date',
         'datetime',
         'displaydate',
+        'displaydatetitle',
         'isodate',
         'email-to-html',
         'exactduration',
@@ -2319,6 +2321,25 @@ class DateTimeFormatterAPI:
     def isodate(self):
         return self._datetime.isoformat()
 
+    def displaydatetitle(self):
+        # Like `displaydate`, but wrapped in an HTML element with `title` and
+        # `datetime` attributes in order that browsers show the timestamp as
+        # hover text.  This is suitable for use when the underlying timestamp
+        # is exact rather than being an estimate.
+        return structured(
+            '<time title="%s" datetime="%s">%s</time>',
+            self.datetime(), self.isodate(), self.displaydate()).escapedtext
+
+    def approximatedatetitle(self):
+        # Like `approximatedate`, but wrapped in an HTML element with `title`
+        # and `datetime` attributes in order that browsers show the timestamp
+        # as hover text.  This is suitable for use when the underlying
+        # timestamp is exact rather than being an estimate.
+        return structured(
+            '<time title="%s" datetime="%s">%s</time>',
+            self.datetime(), self.isodate(),
+            self.approximatedate()).escapedtext
+
     @staticmethod
     def _yearDelta(old, new):
         """Return the difference in years between two datetimes.
diff --git a/lib/lp/app/doc/displaying-dates.txt b/lib/lp/app/doc/displaying-dates.txt
index 22a6c0c..dbd2d54 100644
--- a/lib/lp/app/doc/displaying-dates.txt
+++ b/lib/lp/app/doc/displaying-dates.txt
@@ -135,3 +135,15 @@ also expect the fmt:displaydate to change form, and become "on yyyy-mm-dd".
     >>> test_tales('t/testfmt:displaydate', t=t)
     'on 2015-01-13'
 
+We have two more related TALES formatters, fmt:approximatedatetitle and
+fmt:displaydatetitle.  These act similarly to their siblings without
+"title", but they wrap the time description in an HTML element with "title"
+and "datetime" attributes in order that browsers show the timestamp as hover
+text.
+
+    >>> print(test_tales('t/testfmt:approximatedatetitle', t=t))
+    <time title="2015-01-13 15:35:00"
+          datetime="2015-01-13T15:35:00">2015-01-13</time>
+    >>> print(test_tales('t/testfmt:displaydatetitle', t=t))
+    <time title="2015-01-13 15:35:00"
+          datetime="2015-01-13T15:35:00">on 2015-01-13</time>
diff --git a/lib/lp/blueprints/browser/tests/test_specification.py b/lib/lp/blueprints/browser/tests/test_specification.py
index eef18d8..adfd2f2 100644
--- a/lib/lp/blueprints/browser/tests/test_specification.py
+++ b/lib/lp/blueprints/browser/tests/test_specification.py
@@ -250,7 +250,7 @@ class TestSpecificationSet(BrowserTestCase):
         product = self.factory.makeProduct()
         removeSecurityProxy(product).official_blueprints = True
         self.factory.makeSpecification(product=product)
-        limit = BrowsesWithQueryLimit(29, product.owner, rootsite='blueprints')
+        limit = BrowsesWithQueryLimit(30, product.owner, rootsite='blueprints')
         self.assertThat(product, limit)
         login_celebrity('admin')
         [self.factory.makeSpecification(product=product) for i in range(4)]
diff --git a/lib/lp/blueprints/templates/hassprints-portlet-coming-sprints.pt b/lib/lp/blueprints/templates/hassprints-portlet-coming-sprints.pt
index 7244eeb..c05b346 100644
--- a/lib/lp/blueprints/templates/hassprints-portlet-coming-sprints.pt
+++ b/lib/lp/blueprints/templates/hassprints-portlet-coming-sprints.pt
@@ -17,7 +17,9 @@
         tal:content="sprint/title" />
       on <tal:when replace="sprint/time_starts/fmt:date" />
       <br/><span class="registered">
-        Registered <tal:when replace="sprint/datecreated/fmt:displaydate" />
+        Registered
+        <tal:when
+          replace="structure sprint/datecreated/fmt:displaydatetitle" />
       </span>
     </li>
   </ul>
diff --git a/lib/lp/blueprints/templates/specification-index.pt b/lib/lp/blueprints/templates/specification-index.pt
index c832353..37528bf 100644
--- a/lib/lp/blueprints/templates/specification-index.pt
+++ b/lib/lp/blueprints/templates/specification-index.pt
@@ -163,10 +163,11 @@
 
             <dl id="started-by"
                 tal:attributes="class context/starter/css:select/visible/hidden">
-               <dt>Started by</dt>
-               <dd>
-                 <tal:starter replace="structure context/starter/fmt:link" />
-                 <tal:started_date replace="context/date_started/fmt:displaydate" />
+              <dt>Started by</dt>
+              <dd>
+                <tal:starter replace="structure context/starter/fmt:link" />
+                <tal:started_date
+                  replace="structure context/date_started/fmt:displaydatetitle" />
               </dd>
             </dl>
 
@@ -174,8 +175,9 @@
                 tal:attributes="class context/completer/css:select/visible/hidden">
               <dt>Completed by</dt>
               <dd>
-                 <tal:completer replace="structure context/completer/fmt:link" />
-                 <tal:completed_date replace="context/date_completed/fmt:displaydate" />
+                <tal:completer replace="structure context/completer/fmt:link" />
+                <tal:completed_date
+                  replace="structure context/date_completed/fmt:displaydatetitle" />
               </dd>
             </dl>
           </div>
diff --git a/lib/lp/blueprints/templates/specificationtarget-portlet-latestspecs.pt b/lib/lp/blueprints/templates/specificationtarget-portlet-latestspecs.pt
index 14b514d..6b9cea2 100644
--- a/lib/lp/blueprints/templates/specificationtarget-portlet-latestspecs.pt
+++ b/lib/lp/blueprints/templates/specificationtarget-portlet-latestspecs.pt
@@ -16,7 +16,8 @@
     <li tal:repeat="spec specs">
       <a tal:replace="structure spec/fmt:link" />
       <br /><span class="registered">
-        Registered <tal:when replace="spec/datecreated/fmt:displaydate" />
+        Registered
+        <tal:when replace="structure spec/datecreated/fmt:displaydatetitle" />
       </span>
     </li>
   </ul>
diff --git a/lib/lp/blueprints/templates/sprint-listing-simple.pt b/lib/lp/blueprints/templates/sprint-listing-simple.pt
index 3c6dbf6..1daac1b 100644
--- a/lib/lp/blueprints/templates/sprint-listing-simple.pt
+++ b/lib/lp/blueprints/templates/sprint-listing-simple.pt
@@ -9,9 +9,7 @@
       background: url(/@@/meeting) center left no-repeat; padding-left: 18px;
     "
   >
-    <span
-      tal:attributes="title context/time_starts/fmt:datetime"
-      tal:content="context/time_starts/fmt:approximatedate"
-    >2005-10-05</span>:
+    <tal:starts
+      replace="structure context/time_starts/fmt:approximatedatetitle" />:
     <a tal:attributes="href context/fmt:url" tal:content="context/title" />   </div>
 </tal:root>
diff --git a/lib/lp/bugs/templates/bugtarget-macros-filebug.pt b/lib/lp/bugs/templates/bugtarget-macros-filebug.pt
index 1868d64..906664f 100644
--- a/lib/lp/bugs/templates/bugtarget-macros-filebug.pt
+++ b/lib/lp/bugs/templates/bugtarget-macros-filebug.pt
@@ -322,9 +322,7 @@
                       replace="string: comments" />)
                   last updated
                   <tal:last-updated
-                      content="bug/date_last_updated/fmt:approximatedate">
-                    2007-07-03
-                  </tal:last-updated>
+                    replace="structure bug/date_last_updated/fmt:approximatedatetitle" />
                   <a class="sprite new-window view-bug-link action-icon"
                      target="_blank" tal:attributes="href bug/fmt:url"
                   >view this bug</a>
diff --git a/lib/lp/bugs/templates/bugtarget-portlet-latestbugs.pt b/lib/lp/bugs/templates/bugtarget-portlet-latestbugs.pt
index 7ab60fe..0a59db0 100644
--- a/lib/lp/bugs/templates/bugtarget-portlet-latestbugs.pt
+++ b/lib/lp/bugs/templates/bugtarget-portlet-latestbugs.pt
@@ -12,7 +12,9 @@
     <li tal:repeat="bugtask view/latestBugTasks">
       <a tal:replace="structure bugtask/fmt:link" />
       <br /><span class="registered">
-        Reported <tal:when replace="bugtask/datecreated/fmt:displaydate" />
+        Reported
+        <tal:when
+          replace="structure bugtask/datecreated/fmt:displaydatetitle" />
       </span>
     </li>
   </ul>
diff --git a/lib/lp/bugs/templates/bugtask-edit-form.pt b/lib/lp/bugs/templates/bugtask-edit-form.pt
index f41d53a..1e1a5e6 100644
--- a/lib/lp/bugs/templates/bugtask-edit-form.pt
+++ b/lib/lp/bugs/templates/bugtask-edit-form.pt
@@ -63,51 +63,36 @@
     <tr>
       <th>When:</th>
       <td>
-        <span
-          tal:attributes="title context/datecreated/fmt:datetime"
-          tal:content="context/datecreated/fmt:approximatedate">
-          2006-12-13
-        </span>
+        <tal:created
+          replace="structure context/datecreated/fmt:approximatedatetitle" />
       </td>
     </tr>
     <tr tal:condition="context/date_confirmed">
       <th>Confirmed:</th>
       <td>
-        <span
-          tal:attributes="title context/date_confirmed/fmt:datetime"
-          tal:content="context/date_confirmed/fmt:approximatedate">
-          2006-12-13
-        </span>
+        <tal:confirmed
+          replace="structure context/date_confirmed/fmt:approximatedatetitle" />
       </td>
     </tr>
     <tr tal:condition="context/date_assigned">
       <th>Assigned:</th>
       <td>
-        <span
-          tal:attributes="title context/date_assigned/fmt:datetime"
-          tal:content="context/date_assigned/fmt:approximatedate">
-          2006-12-13
-        </span>
+        <tal:assigned
+          replace="structure context/date_assigned/fmt:approximatedatetitle" />
       </td>
     </tr>
     <tr tal:condition="context/date_inprogress">
       <th>Started work:</th>
       <td>
-        <span
-          tal:attributes="title context/date_inprogress/fmt:datetime"
-          tal:content="context/date_inprogress/fmt:approximatedate">
-          2006-12-13
-        </span>
+        <tal:in-progress
+          replace="structure context/date_inprogress/fmt:approximatedatetitle" />
       </td>
     </tr>
     <tr tal:condition="context/date_closed">
       <th>Completed:</th>
       <td>
-        <span
-          tal:attributes="title context/date_closed/fmt:datetime"
-          tal:content="context/date_closed/fmt:approximatedate">
-          2006-12-13
-        </span>
+        <tal:closed
+          replace="structure context/date_closed/fmt:approximatedatetitle" />
       </td>
     </tr>
   </table>
diff --git a/lib/lp/bugs/templates/bugtracker-portlet-watches.pt b/lib/lp/bugs/templates/bugtracker-portlet-watches.pt
index 636be4f..b1afb0c 100644
--- a/lib/lp/bugs/templates/bugtracker-portlet-watches.pt
+++ b/lib/lp/bugs/templates/bugtracker-portlet-watches.pt
@@ -46,11 +46,8 @@
               </td>
               <td><tal:status tal:replace="watch/remotestatus"/></td>
               <td>
-                <span
-                  tal:attributes="title watch/lastchecked/fmt:datetime"
-                  tal:content="watch/lastchecked/fmt:approximatedate">
-                  13 Jan 2004
-                 </span>
+                <tal:last-checked
+                  replace="structure watch/lastchecked/fmt:approximatedatetitle" />
               </td>
               <td>
                 <span tal:content="watch/next_check/fmt:datetime">
diff --git a/lib/lp/bugs/templates/bugwatch-portlet-activity.pt b/lib/lp/bugs/templates/bugwatch-portlet-activity.pt
index 37b4426..2cba055 100644
--- a/lib/lp/bugs/templates/bugwatch-portlet-activity.pt
+++ b/lib/lp/bugs/templates/bugwatch-portlet-activity.pt
@@ -40,7 +40,7 @@
         <tal:oopsid condition="activity/oops_id">
           (<tal:oops_link replace="structure activity/oops_id/fmt:oops-id" />)
         </tal:oopsid>
-        <tal:time replace="activity/date/fmt:displaydate" />
+        <tal:time replace="structure activity/date/fmt:displaydatetitle" />
       </div>
     </tal:activity>
   </div>
diff --git a/lib/lp/bugs/templates/bugwatch-portlet-details.pt b/lib/lp/bugs/templates/bugwatch-portlet-details.pt
index f87c2b0..f55d69a 100644
--- a/lib/lp/bugs/templates/bugwatch-portlet-details.pt
+++ b/lib/lp/bugs/templates/bugwatch-portlet-details.pt
@@ -31,21 +31,15 @@
       <dl class="bugwatch-data">
         <dt>Changed:</dt>
         <dd>
-          <span
-            tal:attributes="title context/lastchanged/fmt:datetime"
-            tal:content="context/lastchanged/fmt:approximatedate">
-            12 Jan 2004
-           </span>
+          <tal:last-changed
+            replace="structure context/lastchanged/fmt:approximatedatetitle" />
         </dd>
       </dl>
       <dl class="bugwatch-data" id="bugwatch-lastchecked">
         <dt>Checked:</dt>
         <dd>
-          <span
-            tal:attributes="title context/lastchecked/fmt:datetime"
-            tal:content="context/lastchecked/fmt:approximatedate">
-            13 Jan 2004
-           </span>
+          <tal:last-checked
+            replace="structure context/lastchecked/fmt:approximatedatetitle" />
         </dd>
       </dl>
       <dl class="bugwatch-data" id="bugwatch-next_check">
@@ -65,11 +59,8 @@
       <dl class="bugwatch-data">
         <dt>Created:</dt>
         <dd>
-          <span
-            tal:attributes="title context/datecreated/fmt:datetime"
-            tal:content="context/datecreated/fmt:approximatedate">
-            15 Jan 2003
-           </span>
+          <tal:created
+            replace="structure context/datecreated/fmt:approximatedatetitle" />
         </dd>
       </dl>
       <dl class="bugwatch-data">
diff --git a/lib/lp/bugs/templates/cve-listing-detailed.pt b/lib/lp/bugs/templates/cve-listing-detailed.pt
index 9fb27d3..b847665 100644
--- a/lib/lp/bugs/templates/cve-listing-detailed.pt
+++ b/lib/lp/bugs/templates/cve-listing-detailed.pt
@@ -11,13 +11,11 @@
   </div>
   <div>
     Created
-    <span
-      tal:attributes="title context/datecreated/fmt:datetime"
-      tal:content="context/datecreated/fmt:displaydate">2005-10-12</span>
+    <tal:created
+      replace="structure context/datecreated/fmt:displaydatetitle" />
     and modified
-    <span
-      tal:attributes="title context/datemodified/fmt:datetime"
-      tal:replace="context/datemodified/fmt:displaydate">2005-10-12</span>.
+    <tal:modified
+      replace="structure context/datemodified/fmt:displaydatetitle" />.
   </div>
 </div>
 <hr />
diff --git a/lib/lp/code/browser/tests/test_branchmergeproposallisting.py b/lib/lp/code/browser/tests/test_branchmergeproposallisting.py
index 5bc790e..b083358 100644
--- a/lib/lp/code/browser/tests/test_branchmergeproposallisting.py
+++ b/lib/lp/code/browser/tests/test_branchmergeproposallisting.py
@@ -31,6 +31,7 @@ from lp.code.interfaces.gitrepository import IGitRepositorySet
 from lp.registry.enums import SharingPermission
 from lp.registry.model.personproduct import PersonProduct
 from lp.services.database.sqlbase import flush_database_caches
+from lp.services.webapp.interfaces import IOpenLaunchBag
 from lp.services.webapp.publisher import canonical_url
 from lp.testing import (
     admin_logged_in,
@@ -973,6 +974,9 @@ class ActiveReviewsPerformanceMixin:
         recorder1, view1 = self.createProductBMPsAndRecordQueries(base_bmps)
         self.assertEqual(base_bmps, view1.proposal_count)
         self.addDetail("r1tb", text_content(str(recorder1)))
+        # Clear the LaunchBag so that the user's time zone is fetched again,
+        # for fmt:displaydatetitle.
+        getUtility(IOpenLaunchBag).clear()
         recorder2, view2 = self.createProductBMPsAndRecordQueries(
             base_bmps + added_bmps)
         self.assertEqual(base_bmps + added_bmps, view2.proposal_count)
diff --git a/lib/lp/code/templates/branch-index.pt b/lib/lp/code/templates/branch-index.pt
index f9b9b72..cf84904 100644
--- a/lib/lp/code/templates/branch-index.pt
+++ b/lib/lp/code/templates/branch-index.pt
@@ -57,10 +57,11 @@
 <tal:registering metal:fill-slot="registering">
   Created by
     <tal:registrant replace="structure context/registrant/fmt:link" />
-  on
-    <tal:created-on replace="structure context/date_created/fmt:date" />
-  and last modified on
-    <tal:last-modified replace="structure context/date_last_modified/fmt:date" />
+    <tal:created-on
+      replace="structure context/date_created/fmt:displaydatetitle" />
+  and last modified
+    <tal:last-modified
+      replace="structure context/date_last_modified/fmt:displaydatetitle" />
 </tal:registering>
 
 
diff --git a/lib/lp/code/templates/branch-listing.pt b/lib/lp/code/templates/branch-listing.pt
index 15767ba..ed8a65c 100644
--- a/lib/lp/code/templates/branch-listing.pt
+++ b/lib/lp/code/templates/branch-listing.pt
@@ -120,10 +120,8 @@ replace='structure string:&lt;script type="text/javascript"&gt;
                 tal:content="branch/date_created/fmt:datetime">
             2005-02-12 13:45 EST
           </span>
-          <span tal:attributes="title branch/date_created/fmt:datetime"
-                tal:content="branch/date_created/fmt:approximatedate">
-            sometime
-            </span>
+          <tal:created
+            replace="structure branch/date_created/fmt:approximatedatetitle" />
         </td>
         <td tal:condition="context/show_column/product|nothing">
           <a tal:condition="branch/product"
@@ -138,10 +136,8 @@ replace='structure string:&lt;script type="text/javascript"&gt;
                 tal:content="branch/date_last_modified/fmt:datetime">
             2005-02-12 13:45 EST
           </span>
-          <span tal:attributes="title branch/date_last_modified/fmt:datetime"
-                tal:content="branch/date_last_modified/fmt:approximatedate">
-            sometime
-          </span>
+          <tal:last-modified
+            replace="structure branch/date_last_modified/fmt:approximatedatetitle" />
         </td>
 
         <tal:no_commit condition="not: branch/last_commit">
diff --git a/lib/lp/code/templates/branch-macros.pt b/lib/lp/code/templates/branch-macros.pt
index a5f1600..54c94bf 100644
--- a/lib/lp/code/templates/branch-macros.pt
+++ b/lib/lp/code/templates/branch-macros.pt
@@ -62,9 +62,8 @@
       <div tal:condition="mergeproposal/queue_status/enumvalue:MERGED"
            class="branchstatusMERGED">
         Merged
-        <tal:merged replace="mergeproposal/date_merged/fmt:approximatedate">
-          2007-06-04
-        </tal:merged>
+        <tal:merged
+          replace="structure mergeproposal/date_merged/fmt:approximatedatetitle" />
         <tal:have-revision condition="mergeproposal/merged_revision">
           at revision <tal:revision replace="mergeproposal/merged_revision"/>
         </tal:have-revision>
diff --git a/lib/lp/code/templates/branch-messages.pt b/lib/lp/code/templates/branch-messages.pt
index 8a9838a..28216db 100644
--- a/lib/lp/code/templates/branch-messages.pt
+++ b/lib/lp/code/templates/branch-messages.pt
@@ -31,11 +31,11 @@
             <tal:mirrored-yet tal:condition="branch/last_mirrored">
               This branch may be out of date, as Launchpad has not been able to
               access between
-              <span tal:attributes="title branch/last_mirrored/fmt:datetime"
-                    tal:content="branch/last_mirrored/fmt:approximatedate" />
+              <tal:last-mirrored
+                replace="structure branch/last_mirrored/fmt:approximatedatetitle" />
               and
-              <span tal:attributes="title branch/last_mirror_attempt/fmt:datetime"
-                    tal:content="branch/last_mirror_attempt/fmt:approximatedate" />.
+              <tal:last-mirror-attempt
+                replace="structure branch/last_mirror_attempt/fmt:approximatedatetitle" />.
             </tal:mirrored-yet>
             <tal:not-mirrored-yet tal:condition="not:branch/last_mirrored">
               Launchpad has not been able to mirror this branch. The last attempt
@@ -57,8 +57,8 @@
         <tal:mirror-scheduled tal:condition="not:view/mirror_disabled">
           Launchpad will try again
           <tal:mirror-in-future tal:condition="not:view/in_mirror_queue">
-            <span tal:attributes="title branch/next_mirror_time/fmt:datetime"
-                  tal:content="branch/next_mirror_time/fmt:approximatedate" />.
+            <tal:next-mirror-time
+              replace="structure branch/next_mirror_time/fmt:approximatedatetitle" />.
             <tal:owner condition="branch/required:launchpad.Edit">
               If you have fixed the problem, please ask Launchpad to try again.
 
@@ -84,8 +84,8 @@
         <tal:mirrored-yet tal:condition="branch/last_mirrored">
           This branch may be out of date, because Launchpad has not been
           able to access it since
-          <span tal:attributes="title branch/last_mirrored/fmt:datetime"
-                tal:content="branch/last_mirrored/fmt:approximatedate" />.
+          <tal:last-mirrored
+            replace="structure branch/last_mirrored/fmt:approximatedatetitle" />.
         </tal:mirrored-yet>
         <tal:not-mirrored-yet tal:condition="not:branch/last_mirrored">
           This branch has not been mirrored, as Launchpad has been unable to
diff --git a/lib/lp/code/templates/branch-mirror-status.pt b/lib/lp/code/templates/branch-mirror-status.pt
index 36c5129..8d67741 100644
--- a/lib/lp/code/templates/branch-mirror-status.pt
+++ b/lib/lp/code/templates/branch-mirror-status.pt
@@ -5,9 +5,10 @@
   omit-tag="">
 <dl id="last-mirrored">
   <dt>Last mirrored:</dt>
-  <dd tal:attributes="title context/last_mirrored/fmt:datetime"
-      tal:condition="context/last_mirrored"
-      tal:content="context/last_mirrored/fmt:approximatedate"/>
+  <dd tal:condition="context/last_mirrored">
+    <tal:last-mirrored
+      replace="structure context/last_mirrored/fmt:approximatedatetitle" />
+  </dd>
   <dd tal:condition="not:context/last_mirrored">Not mirrored yet</dd>
 </dl>
 
@@ -15,9 +16,10 @@
   <dt>Next mirror:</dt>
   <dd tal:condition="view/mirror_disabled">Disabled</dd>
   <tal:mirror-enabled tal:condition="not:view/mirror_disabled">
-    <dd tal:attributes="title context/next_mirror_time/fmt:datetime"
-        tal:condition="not:view/in_mirror_queue"
-        tal:content="context/next_mirror_time/fmt:approximatedate"/>
+    <dd tal:condition="not:view/in_mirror_queue">
+      <tal:next-mirror-time
+        replace="structure context/next_mirror_time/fmt:approximatedatetitle" />
+    </dd>
     <dd tal:condition="view/in_mirror_queue">As soon as possible</dd>
   </tal:mirror-enabled>
 </dl>
diff --git a/lib/lp/code/templates/branchmergeproposal-heading.pt b/lib/lp/code/templates/branchmergeproposal-heading.pt
index 5e5f757..69cd2ab 100644
--- a/lib/lp/code/templates/branchmergeproposal-heading.pt
+++ b/lib/lp/code/templates/branchmergeproposal-heading.pt
@@ -6,7 +6,9 @@
 
   <div>
     <div style="float: right">
-      Proposed <tal:modified replace="context/date_created/fmt:displaydate" />
+      Proposed
+      <tal:modified
+        replace="structure context/date_created/fmt:displaydatetitle" />
 
     </div>
     <tal:merge-fragment tal:replace="structure context/@@+link-summary" />
diff --git a/lib/lp/code/templates/branchmergeproposal-index.pt b/lib/lp/code/templates/branchmergeproposal-index.pt
index d29ee79..6ba4621 100644
--- a/lib/lp/code/templates/branchmergeproposal-index.pt
+++ b/lib/lp/code/templates/branchmergeproposal-index.pt
@@ -56,7 +56,8 @@
 <tal:registering metal:fill-slot="registering">
   Proposed by
   <tal:registrant replace="structure context/registrant/fmt:link"/>
-  <tal:modified replace="context/date_created/fmt:displaydate" />
+  <tal:modified
+    replace="structure context/date_created/fmt:displaydatetitle" />
 </tal:registering>
 
 
diff --git a/lib/lp/code/templates/branchmergeproposal-listing.pt b/lib/lp/code/templates/branchmergeproposal-listing.pt
index 10ea94e..f1a40be 100644
--- a/lib/lp/code/templates/branchmergeproposal-listing.pt
+++ b/lib/lp/code/templates/branchmergeproposal-listing.pt
@@ -45,7 +45,8 @@
             tal:content="proposal/queue_status/title" />
         <td>
           <tal:registrant replace="structure proposal/registrant/fmt:link" />
-          <tal:date replace="proposal/date_review_requested/fmt:displaydate"/>
+          <tal:date
+            replace="structure proposal/date_review_requested/fmt:displaydatetitle" />
         </td>
 
         <td tal:condition="context/show_column/date_reviewed|nothing">
@@ -54,7 +55,8 @@
                 tal:content="proposal/date_reviewed/fmt:datetime">
             2005-02-12 13:45 EST
           </span>
-          <tal:date replace="proposal/date_reviewed/fmt:approximatedate"/>
+          <tal:date
+            replace="structure proposal/date_reviewed/fmt:approximatedatetitle"/>
         </td>
         <td tal:condition="context/show_column/review|nothing">
           <tal:review-vote define="comment proposal/reviewer_vote/comment|nothing">
diff --git a/lib/lp/code/templates/branchmergeproposal-macros.pt b/lib/lp/code/templates/branchmergeproposal-macros.pt
index c660572..627398b 100644
--- a/lib/lp/code/templates/branchmergeproposal-macros.pt
+++ b/lib/lp/code/templates/branchmergeproposal-macros.pt
@@ -53,7 +53,8 @@
       </td>
       <td>
         <tal:registrant replace="structure proposal/registrant/fmt:link" />
-        <tal:date replace="proposal/date_review_requested/fmt:displaydate"/>
+        <tal:date
+          replace="structure proposal/date_review_requested/fmt:displaydatetitle" />
       </td>
       <td style="text-align: right">
         <tal:size replace='proposal/preview_diff/diff_lines_count' condition="proposal/preview_diff"/>
diff --git a/lib/lp/code/templates/branchmergeproposal-pagelet-summary.pt b/lib/lp/code/templates/branchmergeproposal-pagelet-summary.pt
index 09841d6..7cf4fa6 100644
--- a/lib/lp/code/templates/branchmergeproposal-pagelet-summary.pt
+++ b/lib/lp/code/templates/branchmergeproposal-pagelet-summary.pt
@@ -59,7 +59,8 @@
             <tal:reviewer replace="structure context/reviewer/fmt:link">
               Some User
             </tal:reviewer>
-            <tal:modified replace="context/date_reviewed/fmt:displaydate" />
+            <tal:modified
+              replace="structure context/date_reviewed/fmt:displaydatetitle" />
           </td>
         </tr>
         <tr id="summary-row-3-approved-revision"
diff --git a/lib/lp/code/templates/branchmergeproposal-vote-summary.pt b/lib/lp/code/templates/branchmergeproposal-vote-summary.pt
index 8a7b051..7c3a906 100644
--- a/lib/lp/code/templates/branchmergeproposal-vote-summary.pt
+++ b/lib/lp/code/templates/branchmergeproposal-vote-summary.pt
@@ -27,7 +27,8 @@
     <tal:vote-tags condition="review/review_type_str">
       (<tal:tag replace="review/review_type_str"/>)
     </tal:vote-tags>
-    <tal:date replace="review/date_of_comment/fmt:displaydate" />
+    <tal:date
+      replace="structure review/date_of_comment/fmt:displaydatetitle" />
   </dd>
   <dd tal:repeat="review view/requested_reviews"
       tal:attributes="id string:review-${review/reviewer/name}">
@@ -39,7 +40,8 @@
       (<tal:tag replace="review/review_type_str"/>)
     </tal:vote-tags>
     requested
-    <tal:date replace="review/date_requested/fmt:approximatedate"/>
+    <tal:date
+      replace="structure review/date_requested/fmt:approximatedatetitle" />
   </dd>
   <dd tal:condition="context/preview_diff"
       tal:attributes="class string:popup-diff mp-${context/id}">
diff --git a/lib/lp/code/templates/branchmergeproposal-votes.pt b/lib/lp/code/templates/branchmergeproposal-votes.pt
index f6bb722..3c3f80b 100644
--- a/lib/lp/code/templates/branchmergeproposal-votes.pt
+++ b/lib/lp/code/templates/branchmergeproposal-votes.pt
@@ -26,7 +26,8 @@
       <td>
         <tal:date-requested condition="review/show_date_requested">
           <span tal:attributes="title string:Requested by ${review/registrant/displayname}">
-            <tal:date replace="review/date_requested/fmt:approximatedate"/>
+            <tal:date
+              replace="structure review/date_requested/fmt:approximatedatetitle" />
           </span>
         </tal:date-requested>
       </td>
@@ -35,7 +36,8 @@
               tal:content="review/status_text">
           Approved
         </span>
-        <tal:date replace="review/date_of_comment/fmt:displaydate" />
+        <tal:date
+          replace="structure review/date_of_comment/fmt:displaydatetitle" />
         <a tal:condition="review/can_change_review" href="+review">
           <img src="/@@/edit" title="Vote again" alt="vote"/>
         </a>
@@ -55,7 +57,8 @@
       <td>
         <tal:date-requested condition="review/show_date_requested">
           <span tal:attributes="title string:Requested by ${review/registrant/displayname}">
-            <tal:date replace="review/date_requested/fmt:approximatedate"/>
+            <tal:date
+              replace="structure review/date_requested/fmt:approximatedatetitle" />
           </span>
         </tal:date-requested>
       </td>
diff --git a/lib/lp/code/templates/codeimport-machine-index.pt b/lib/lp/code/templates/codeimport-machine-index.pt
index 7237758..c72c416 100644
--- a/lib/lp/code/templates/codeimport-machine-index.pt
+++ b/lib/lp/code/templates/codeimport-machine-index.pt
@@ -43,8 +43,8 @@
           <tal:jobs repeat="job jobs">
             <tr>
               <td><tal:target replace="structure job/code_import/target/fmt:link"/></td>
-              <td>Started: <tal:started replace="job/date_started/fmt:approximatedate"/></td>
-              <td>Last heartbeat: <tal:heartbeat replace="job/heartbeat/fmt:approximatedate"/></td>
+              <td>Started: <tal:started replace="structure job/date_started/fmt:approximatedatetitle"/></td>
+              <td>Last heartbeat: <tal:heartbeat replace="structure job/heartbeat/fmt:approximatedatetitle"/></td>
             </tr>
             <tr tal:condition="job/logtail">
               <td class="logtail" colspan="3"
diff --git a/lib/lp/code/templates/codeimport-machines.pt b/lib/lp/code/templates/codeimport-machines.pt
index e389eb6..c6068f3 100644
--- a/lib/lp/code/templates/codeimport-machines.pt
+++ b/lib/lp/code/templates/codeimport-machines.pt
@@ -64,8 +64,8 @@
                   <tal:jobs repeat="job jobs">
                     <tr>
                       <td><tal:target replace="structure job/code_import/target/fmt:link"/></td>
-                      <td>Started: <tal:started replace="job/date_started/fmt:approximatedate"/></td>
-                      <td>Last heartbeat: <tal:heartbeat replace="job/heartbeat/fmt:approximatedate"/></td>
+                      <td>Started: <tal:started replace="structure job/date_started/fmt:approximatedatetitle"/></td>
+                      <td>Last heartbeat: <tal:heartbeat replace="structure job/heartbeat/fmt:approximatedatetitle"/></td>
                     </tr>
                   </tal:jobs>
                 </table>
diff --git a/lib/lp/code/templates/codeimport-macros.pt b/lib/lp/code/templates/codeimport-macros.pt
index d69d9a9..3e4d603 100644
--- a/lib/lp/code/templates/codeimport-macros.pt
+++ b/lib/lp/code/templates/codeimport-macros.pt
@@ -11,14 +11,11 @@
   <img tal:attributes="src python:view.iconForCodeImportResultStatus(result.status);
                        title result/status/title"/>
   Import started
-  <tal:when replace="result/date_job_started/fmt:displaydate">
-    4 hours ago
-  </tal:when>
+  <tal:when replace="structure result/date_job_started/fmt:displaydatetitle" />
   on <tal:machine replace="structure result/machine/fmt:link" />
   and finished
-  <tal:when replace="result/date_job_finished/fmt:displaydate">
-    3 hours ago
-  </tal:when>
+  <tal:when
+    replace="structure result/date_job_finished/fmt:displaydatetitle" />
   taking
   <tal:duration replace="result/job_duration/fmt:approximateduration">
     five minutes
diff --git a/lib/lp/code/templates/codereviewnewrevisions-header.pt b/lib/lp/code/templates/codereviewnewrevisions-header.pt
index f80eded..50d766d 100644
--- a/lib/lp/code/templates/codereviewnewrevisions-header.pt
+++ b/lib/lp/code/templates/codereviewnewrevisions-header.pt
@@ -5,6 +5,6 @@
 
   <tal:source replace="structure context/source/fmt:link"/>
   updated
-  <tal:date replace="context/date/fmt:displaydate" />
+  <tal:date replace="structure context/date/fmt:displaydatetitle" />
 
 </tal:root>
diff --git a/lib/lp/code/templates/import-details.pt b/lib/lp/code/templates/import-details.pt
index be10f0d..28cbb45 100644
--- a/lib/lp/code/templates/import-details.pt
+++ b/lib/lp/code/templates/import-details.pt
@@ -102,9 +102,8 @@
             An import is currently running on
             <tal:machine content="structure job/machine/fmt:link" />,
             and was started
-            <tal:date-started replace="job/date_started/fmt:displaydate">
-              2 hours ago
-            </tal:date-started>.
+            <tal:date-started
+              replace="structure job/date_started/fmt:displaydatetitle" />.
             <tal:is-logtail condition="job/logtail">
               The last few lines of the job's output were:
               <div class="logtail">
@@ -124,9 +123,8 @@
                 </tal:requested-by-user>)</tal:requested-by>.
             </tal:overdue>
             <tal:not-overdue condition="not: job/isOverdue">
-              <tal:date-started replace="job/date_due/fmt:displaydate">
-                in 2 hours
-              </tal:date-started>.
+              <tal:date-started
+                replace="structure job/date_due/fmt:displaydatetitle" />.
               <tal:button
                  condition="view/user"
                  replace="structure view/context/@@+request-import" />
@@ -146,9 +144,8 @@
         <tal:last-successful condition="code_import/date_last_successful">
           <p>
             Last successful import was
-            <tal:last-successful replace="code_import/date_last_successful/fmt:displaydate">
-              2 hours ago
-            </tal:last-successful>.
+            <tal:last-successful
+              replace="structure code_import/date_last_successful/fmt:displaydatetitle" />.
           </p>
         </tal:last-successful>
 
diff --git a/lib/lp/code/templates/sourcepackagerecipe-builds.pt b/lib/lp/code/templates/sourcepackagerecipe-builds.pt
index 4be6686..158333e 100644
--- a/lib/lp/code/templates/sourcepackagerecipe-builds.pt
+++ b/lib/lp/code/templates/sourcepackagerecipe-builds.pt
@@ -19,7 +19,8 @@
                tal:attributes="href build/fmt:url"></a>
           </td>
           <td>
-            <tal:date replace="buildview/date/fmt:displaydate" />
+            <tal:date
+              replace="structure buildview/date/fmt:displaydatetitle" />
             <tal:estimate condition="buildview/estimate">
               (estimated)
             </tal:estimate>
@@ -48,7 +49,8 @@
                  tal:attributes="href binary/fmt:url">package - version</a>
             </td>
             <td>
-              <tal:date replace="binaryview/date/fmt:displaydate" />
+              <tal:date
+                replace="structure binaryview/date/fmt:displaydatetitle" />
               <tal:estimate condition="binaryview/estimate">
                 (estimated)
               </tal:estimate>
diff --git a/lib/lp/registry/templates/announcement-macros.pt b/lib/lp/registry/templates/announcement-macros.pt
index 07af6bc..7738d7b 100644
--- a/lib/lp/registry/templates/announcement-macros.pt
+++ b/lib/lp/registry/templates/announcement-macros.pt
@@ -50,7 +50,8 @@
       </strong>
       <strong tal:condition="announcement/date_last_modified">
           Updated
-          <span tal:replace="announcement/date_last_modified/fmt:displaydate" />.
+          <tal:modified
+            replace="structure announcement/date_last_modified/fmt:displaydatetitle" />.
       </strong>
       <a rel="nofollow" class="sprite external-link"
          tal:condition="announcement/url"
diff --git a/lib/lp/registry/templates/distributionsourcepackage-index.pt b/lib/lp/registry/templates/distributionsourcepackage-index.pt
index 28a097a..c5bb171 100644
--- a/lib/lp/registry/templates/distributionsourcepackage-index.pt
+++ b/lib/lp/registry/templates/distributionsourcepackage-index.pt
@@ -156,9 +156,9 @@
           (<tal:component content="row/component"/>)
         </td>
         <td>
-          <tal:date_published condition="row/date_published">
-            <span tal:replace="row/date_published/fmt:approximatedate"/>
-          </tal:date_published>
+          <tal:date_published
+            condition="row/date_published"
+            content="structure row/date_published/fmt:approximatedatetitle" />
           <tal:not_published
                condition="not: row/date_published"
                content="string:(not published)"/>
diff --git a/lib/lp/registry/templates/distroseriesdifferencecomment-latest-comment-fragment.pt b/lib/lp/registry/templates/distroseriesdifferencecomment-latest-comment-fragment.pt
index 0298f1a..08e8add 100644
--- a/lib/lp/registry/templates/distroseriesdifferencecomment-latest-comment-fragment.pt
+++ b/lib/lp/registry/templates/distroseriesdifferencecomment-latest-comment-fragment.pt
@@ -9,7 +9,7 @@
   </tal:text>
   <br />
   <span class="greyed-out greylink"><tal:date
-    replace="context/comment_date/fmt:approximatedate">2005-09-16</tal:date>
+    replace="structure context/comment_date/fmt:approximatedatetitle" />
   by
   <tal:author replace="structure context/comment_author/fmt:link" /></span>
 </span>
diff --git a/lib/lp/registry/templates/product-index.pt b/lib/lp/registry/templates/product-index.pt
index 73d339b..7d60223 100644
--- a/lib/lp/registry/templates/product-index.pt
+++ b/lib/lp/registry/templates/product-index.pt
@@ -7,7 +7,8 @@
   i18n:domain="launchpad">
   <tal:registering metal:fill-slot="registering">
     Registered
-    <tal:created replace="context/datecreated/fmt:approximatedate" />
+    <tal:created
+      replace="structure context/datecreated/fmt:approximatedatetitle" />
     by
     <tal:registrant replace="structure context/registrant/fmt:link" />
   </tal:registering>
diff --git a/lib/lp/registry/templates/product-portlet-packages.pt b/lib/lp/registry/templates/product-portlet-packages.pt
index 12959db..adeef6b 100644
--- a/lib/lp/registry/templates/product-portlet-packages.pt
+++ b/lib/lp/registry/templates/product-portlet-packages.pt
@@ -27,7 +27,9 @@
             tal:condition="release">
           <strong>Version
             <tal:version content="release/version">2.3</tal:version></strong>
-          uploaded <tal:date replace="release/dateuploaded/fmt:displaydate" />
+          uploaded
+          <tal:date
+            replace="structure release/dateuploaded/fmt:displaydatetitle" />
           </span>
         </li>
       </tal:pair>
diff --git a/lib/lp/registry/templates/product-portlet-requires-subscription.pt b/lib/lp/registry/templates/product-portlet-requires-subscription.pt
index 0bd703e..044b2c3 100644
--- a/lib/lp/registry/templates/product-portlet-requires-subscription.pt
+++ b/lib/lp/registry/templates/product-portlet-requires-subscription.pt
@@ -16,7 +16,7 @@
   <p tal:condition="context/commercial_subscription/date_expires | nothing">
     <strong>Current subscription expires
     <tal:date_expire
-     tal:replace="context/commercial_subscription/date_expires/fmt:displaydate"
+     replace="structure context/commercial_subscription/date_expires/fmt:displaydatetitle"
      />.</strong>
   </p>
 
diff --git a/lib/lp/registry/templates/productrelease-portlet-downloads.pt b/lib/lp/registry/templates/productrelease-portlet-downloads.pt
index 508c664..8febf17 100644
--- a/lib/lp/registry/templates/productrelease-portlet-downloads.pt
+++ b/lib/lp/registry/templates/productrelease-portlet-downloads.pt
@@ -17,7 +17,8 @@
   </ul>
 
   <div class="released">
-    released <tal:date replace="context/datereleased/fmt:displaydate" />
+    released
+    <tal:date replace="structure context/datereleased/fmt:displaydatetitle" />
   </div>
 </div
 >
diff --git a/lib/lp/registry/templates/products-index.pt b/lib/lp/registry/templates/products-index.pt
index cbdd0fd..be22f03 100644
--- a/lib/lp/registry/templates/products-index.pt
+++ b/lib/lp/registry/templates/products-index.pt
@@ -137,7 +137,8 @@
               <td>
                 <tal:link replace="structure product/fmt:link" />
                 registered
-                <tal:date replace="product/datecreated/fmt:displaydate" />
+                <tal:date
+                  replace="structure product/datecreated/fmt:displaydatetitle" />
               </td>
             </tr>
           </tal:product>
diff --git a/lib/lp/registry/templates/project-index.pt b/lib/lp/registry/templates/project-index.pt
index 84c16b3..5248595 100644
--- a/lib/lp/registry/templates/project-index.pt
+++ b/lib/lp/registry/templates/project-index.pt
@@ -26,7 +26,8 @@
   <body>
     <tal:registering metal:fill-slot="registering">
       Registered
-      <tal:created replace="context/datecreated/fmt:approximatedate" />
+      <tal:created
+        replace="structure context/datecreated/fmt:approximatedatetitle" />
       by
       <tal:registrant replace="structure context/registrant/fmt:link" />
     </tal:registering>
diff --git a/lib/lp/services/comments/templates/comment-header.pt b/lib/lp/services/comments/templates/comment-header.pt
index 49c164c..2d8cbe2 100644
--- a/lib/lp/services/comments/templates/comment-header.pt
+++ b/lib/lp/services/comments/templates/comment-header.pt
@@ -5,5 +5,5 @@
 
   <tal:author replace="structure context/comment_author/fmt:link-display-name-id"/>
   <tal:has-body condition="context/has_body">wrote</tal:has-body>
-  <tal:date replace="context/comment_date/fmt:displaydate" />
+  <tal:date replace="structure context/comment_date/fmt:displaydatetitle" />
 </tal:root>
diff --git a/lib/lp/services/oauth/templates/oauth-authorize.pt b/lib/lp/services/oauth/templates/oauth-authorize.pt
index 1ae4611..5eb5f0c 100644
--- a/lib/lp/services/oauth/templates/oauth-authorize.pt
+++ b/lib/lp/services/oauth/templates/oauth-authorize.pt
@@ -164,7 +164,7 @@
             <p tal:condition="view/token/date_expires">
               The integration you just authorized will expire
               <tal:date
-                 replace="structure view/token/date_expires/fmt:approximatedate" />.
+                 replace="structure view/token/date_expires/fmt:approximatedatetitle" />.
               At that time, you'll have to re-authorize
               <strong
                  tal:content="view/token/consumer/integrated_desktop_name">hostname</strong>,
diff --git a/lib/lp/snappy/templates/snap-index.pt b/lib/lp/snappy/templates/snap-index.pt
index ccbcf0c..48607a0 100644
--- a/lib/lp/snappy/templates/snap-index.pt
+++ b/lib/lp/snappy/templates/snap-index.pt
@@ -172,7 +172,7 @@
               </td>
               <td>
                 <tal:date condition="request/date_finished"
-                          replace="request/date_finished/fmt:displaydate"/>
+                          replace="structure request/date_finished/fmt:displaydatetitle"/>
                 <tal:error-message condition="request/error_message">
                   (<span tal:replace="request/error_message"/>)
                 </tal:error-message>
@@ -192,7 +192,7 @@
                    tal:attributes="href build/fmt:url"/>
               </td>
               <td class="datebuilt">
-                <tal:date replace="build/date/fmt:displaydate"/>
+                <tal:date replace="structure build/date/fmt:displaydatetitle"/>
                 <tal:estimate condition="build/estimate">
                   (estimated)
                 </tal:estimate>
diff --git a/lib/lp/soyuz/templates/archive-index.pt b/lib/lp/soyuz/templates/archive-index.pt
index d67a632..8f48a2a 100644
--- a/lib/lp/soyuz/templates/archive-index.pt
+++ b/lib/lp/soyuz/templates/archive-index.pt
@@ -134,8 +134,8 @@ sudo apt-get update
                 <span style="color: red"
                       tal:condition="not: dependency/dependency/enabled"
                  >[disabled]</span>
-                (included <span
-                 tal:replace="dependency/date_created/fmt:displaydate" />)
+                (included <tal:created
+                 replace="structure dependency/date_created/fmt:displaydatetitle" />)
               </li>
             </ul>
           </div> <!--archive-dependencies -->
@@ -256,9 +256,8 @@ sudo apt-get update
                   <span tal:replace="structure signer">Joe Bloggs</span>
                   <tal:date_published
                     condition="publishing/datepublished">
-                  (<span
-                    tal:replace="publishing/datepublished/fmt:approximatedate">
-                     2007-08-01</span>)
+                  (<tal:published
+                    replace="structure publishing/datepublished/fmt:approximatedatetitle" />)
                   </tal:date_published>
               </td>
             </tr>
diff --git a/lib/lp/soyuz/templates/distroseries-portlet-latestuploads.pt b/lib/lp/soyuz/templates/distroseries-portlet-latestuploads.pt
index 2c530a2..6028ca7 100644
--- a/lib/lp/soyuz/templates/distroseries-portlet-latestuploads.pt
+++ b/lib/lp/soyuz/templates/distroseries-portlet-latestuploads.pt
@@ -19,7 +19,8 @@
        tal:content="source/displayname" />
       <br /><span class="registered"> Upload by
       <a tal:replace="structure source/sourcepackagerelease/creator/fmt:link" />
-      <tal:dateuploaded replace="source/dateuploaded/fmt:displaydate" />
+      <tal:dateuploaded
+        replace="structure source/dateuploaded/fmt:displaydatetitle" />
       </span>
     </li>
   </ul>
diff --git a/lib/lp/soyuz/templates/livefs-index.pt b/lib/lp/soyuz/templates/livefs-index.pt
index edadcd3..0d85422 100644
--- a/lib/lp/soyuz/templates/livefs-index.pt
+++ b/lib/lp/soyuz/templates/livefs-index.pt
@@ -75,7 +75,8 @@
                    tal:attributes="href build/fmt:url"/>
               </td>
               <td>
-                <tal:date replace="buildview/date/fmt:displaydate"/>
+                <tal:date
+                  replace="structure buildview/date/fmt:displaydatetitle"/>
                 <tal:estimate condition="buildview/estimate">
                   (estimated)
                 </tal:estimate>
diff --git a/lib/lp/translations/templates/person-translations.pt b/lib/lp/translations/templates/person-translations.pt
index 89cb290..0b512e8 100644
--- a/lib/lp/translations/templates/person-translations.pt
+++ b/lib/lp/translations/templates/person-translations.pt
@@ -38,8 +38,8 @@
       Last translation activity by
       <tal:name replace="context/displayname">Foo Bar</tal:name>
       was
-      <tal:date replace="view/latest_activity/date/fmt:displaydate">
-        on 2009-10-12</tal:date>.
+      <tal:date
+        replace="structure view/latest_activity/date/fmt:displaydatetitle" />.
     </tal:active>
     <tal:inactive tal:condition="not: view/latest_activity">
       No translation activities recorded for
diff --git a/lib/lp/translations/templates/translationimportqueueentry-portlet-details.pt b/lib/lp/translations/templates/translationimportqueueentry-portlet-details.pt
index 0a48a43..4c1d13a 100644
--- a/lib/lp/translations/templates/translationimportqueueentry-portlet-details.pt
+++ b/lib/lp/translations/templates/translationimportqueueentry-portlet-details.pt
@@ -40,9 +40,8 @@
     <a tal:replace="structure context/importer/fmt:link">
       Arne Goetje
     </a>
-    <tal:upload_date replace="context/dateimported/fmt:displaydate">
-      2010-02-10
-    </tal:upload_date>.
+    <tal:upload_date
+      replace="structure context/dateimported/fmt:displaydatetitle" />.
     <tal:status_change replace="view/status_change_date">
       Entry last changed on 2010-02-12.
     </tal:status_change>