diff tests/test-hgweb-commands.t @ 15375:fe9d36a6853e stable

hgweb: fix dynamic date calculation not working under Safari While Chrome, Firefox, and IE 6+ support the current date format being passed to Date(), Safari doesn't: > new Date('Mon Oct 24 13:58:01 2011 +0200') Invalid Date However, the rfc822date format--officially supported by ECMAScript[1]--does work: > new Date('Mon, 24 Oct 2011 13:58:01 +0200') Mon Oct 24 2011 04:58:01 GMT-0700 (PDT) This change replaces all instances of {date|date} in HTML with {date|rfc822date}. For elements that only have the "age" class, there's no outward change for users with JavaScript enabled. For elements with both the "age" and "date" classes, the full date displayed uses the new format. Tested in IE 6, Safari 5.1.1, Google Chrome 15, and Firefox 7.0.1. [1]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/parse
author Brodie Rao <brodie@bitheap.org>
date Thu, 27 Oct 2011 11:57:08 -0700
parents bd88561afb4b
children c5c9ca3719f9 41885892796e
line wrap: on
line diff
--- a/tests/test-hgweb-commands.t	Thu Oct 27 18:15:34 2011 -0500
+++ b/tests/test-hgweb-commands.t	Thu Oct 27 11:57:08 2011 -0700
@@ -246,17 +246,17 @@
     <th class="description">description</th>
    </tr>
    <tr class="parity0">
-    <td class="age">Thu Jan 01 00:00:00 1970 +0000</td>
+    <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
     <td class="description"><a href="/rev/1d22e65f027e">branch</a><span class="branchhead">stable</span> <span class="tag">tip</span> <span class="tag">something</span> </td>
    </tr>
    <tr class="parity1">
-    <td class="age">Thu Jan 01 00:00:00 1970 +0000</td>
+    <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
     <td class="description"><a href="/rev/a4f92ed23982">Added tag 1.0 for changeset 2ef0ac749a14</a><span class="branchhead">default</span> </td>
    </tr>
    <tr class="parity0">
-    <td class="age">Thu Jan 01 00:00:00 1970 +0000</td>
+    <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
     <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> <span class="tag">anotherthing</span> </td>
    </tr>
@@ -339,7 +339,7 @@
   </tr>
   <tr>
    <th class="date">date</th>
-   <td class="date age">Thu Jan 01 00:00:00 1970 +0000</td></tr>
+   <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td></tr>
   <tr>
    <th class="author">parents</th>
    <td class="author"></td>
@@ -476,7 +476,7 @@
     <th class="description">description</th>
    </tr>
    <tr class="parity0">
-    <td class="age">Thu Jan 01 00:00:00 1970 +0000</td>
+    <td class="age">Thu, 01 Jan 1970 00:00:00 +0000</td>
     <td class="author">test</td>
     <td class="description"><a href="/rev/2ef0ac749a14">base</a><span class="tag">1.0</span> <span class="tag">anotherthing</span> </td>
    </tr>
@@ -586,7 +586,7 @@
   </tr>
   <tr>
    <th class="date">date</th>
-   <td class="date age">Thu Jan 01 00:00:00 1970 +0000</td>
+   <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
   </tr>
   <tr>
    <th class="author">parents</th>
@@ -701,7 +701,7 @@
   <table cellspacing="0">
   
   <tr class="parity0">
-  <td class="age"><i class="age">Thu Jan 01 00:00:00 1970 +0000</i></td>
+  <td class="age"><i class="age">Thu, 01 Jan 1970 00:00:00 +0000</i></td>
   <td><i>test</i></td>
   <td>
   <a class="list" href="/rev/1d22e65f027e?style=gitweb">
@@ -715,7 +715,7 @@
   </td>
   </tr>
   <tr class="parity1">
-  <td class="age"><i class="age">Thu Jan 01 00:00:00 1970 +0000</i></td>
+  <td class="age"><i class="age">Thu, 01 Jan 1970 00:00:00 +0000</i></td>
   <td><i>test</i></td>
   <td>
   <a class="list" href="/rev/a4f92ed23982?style=gitweb">
@@ -729,7 +729,7 @@
   </td>
   </tr>
   <tr class="parity0">
-  <td class="age"><i class="age">Thu Jan 01 00:00:00 1970 +0000</i></td>
+  <td class="age"><i class="age">Thu, 01 Jan 1970 00:00:00 +0000</i></td>
   <td><i>test</i></td>
   <td>
   <a class="list" href="/rev/2ef0ac749a14?style=gitweb">
@@ -749,7 +749,7 @@
   <table cellspacing="0">
   
   <tr class="parity0">
-  <td class="age"><i class="age">Thu Jan 01 00:00:00 1970 +0000</i></td>
+  <td class="age"><i class="age">Thu, 01 Jan 1970 00:00:00 +0000</i></td>
   <td><a class="list" href="/rev/2ef0ac749a14?style=gitweb"><b>1.0</b></a></td>
   <td class="link">
   <a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
@@ -764,7 +764,7 @@
   <table cellspacing="0">
   
   <tr class="parity0">
-  <td class="age"><i class="age">Thu Jan 01 00:00:00 1970 +0000</i></td>
+  <td class="age"><i class="age">Thu, 01 Jan 1970 00:00:00 +0000</i></td>
   <td><a class="list" href="/rev/2ef0ac749a14?style=gitweb"><b>anotherthing</b></a></td>
   <td class="link">
   <a href="/rev/2ef0ac749a14?style=gitweb">changeset</a> |
@@ -773,7 +773,7 @@
   </td>
   </tr>
   <tr class="parity1">
-  <td class="age"><i class="age">Thu Jan 01 00:00:00 1970 +0000</i></td>
+  <td class="age"><i class="age">Thu, 01 Jan 1970 00:00:00 +0000</i></td>
   <td><a class="list" href="/rev/1d22e65f027e?style=gitweb"><b>something</b></a></td>
   <td class="link">
   <a href="/rev/1d22e65f027e?style=gitweb">changeset</a> |
@@ -788,7 +788,7 @@
   <table cellspacing="0">
   
   <tr class="parity0">
-  <td class="age"><i class="age">Thu Jan 01 00:00:00 1970 +0000</i></td>
+  <td class="age"><i class="age">Thu, 01 Jan 1970 00:00:00 +0000</i></td>
   <td><a class="list" href="/shortlog/1d22e65f027e?style=gitweb"><b>1d22e65f027e</b></a></td>
   <td class="">stable</td>
   <td class="link">
@@ -798,7 +798,7 @@
   </td>
   </tr>
   <tr class="parity1">
-  <td class="age"><i class="age">Thu Jan 01 00:00:00 1970 +0000</i></td>
+  <td class="age"><i class="age">Thu, 01 Jan 1970 00:00:00 +0000</i></td>
   <td><a class="list" href="/shortlog/a4f92ed23982?style=gitweb"><b>a4f92ed23982</b></a></td>
   <td class="">default</td>
   <td class="link">