Skip to content

Commit fce1bf9

Browse files
committed
Fix date display on the compare page.
Currently only 7 chars are extracted, giving a "YYYY-MM" string being shown. I suspect this was copied from the code below which extracts 7 chars from the git id/tag. This commit changes it to extract 10 chars for dates, giving "YYYY-MM-DD".
1 parent 53f2ca5 commit fce1bf9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

site/static/compare.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
853853
before() {
854854
if (!this.data) {
855855
const start = findQueryParam("start");
856-
return start ? start.substring(0, 7) : "???";
856+
// 0,10 extracts "YYYY-MM-DD".
857+
return start ? start.substring(0, 10) : "???";
857858
}
858859
if (this.data.a.pr) {
859860
return `#${this.data.a.pr}`;
@@ -862,12 +863,15 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
862863
return this.formatDate(this.data.a.date);
863864
}
864865

866+
// 0,7 extracts 7 chars from the git commit id/tag, which is probably
867+
// enough to distinguish it. (It is only for display purposes.)
865868
return this.data.a.commit.substring(0, 7);
866869
},
867870
after() {
868871
if (!this.data) {
869872
const end = findQueryParam("end");
870-
return end ? end.substring(0, 7) : "???";
873+
// 0,10 extracts "YYYY-MM-DD".
874+
return end ? end.substring(0, 10) : "???";
871875
}
872876

873877
if (this.data.b.pr) {
@@ -877,6 +881,8 @@ <h2>Comparing <span id="stat-header">{{stat}}</span> between <span id="before">{
877881
return this.formatDate(this.data.b.date);
878882
}
879883

884+
// 0,7 extracts 7 chars from the git commit id/tag, which is probably
885+
// enough to distinguish it. (It is only for display purposes.)
880886
return this.data.b.commit.substring(0, 7);
881887
},
882888
stat() {

0 commit comments

Comments
 (0)