@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Facts: Always render YYYY-MM-DD dates with eight digits in chart tooltips

Summary:
Always render dates in tooltips when hovering over data points in Burndown charts etc of the Facts application as `YYYY-MM-DD` instead of `YYYY-M-D` by converting the integer to a string and if its length is only one character, prepend a zero.

Closes T15819

Test Plan:
* Enable the Facts application, go to the Reports of a Project with task changes over time, hover over data points and read the tooltip.
* Check Console of web browser's developer tools for no errors.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15819

Differential Revision: https://we.phorge.it/D25630

+8 -2
+8 -2
webroot/rsrc/js/application/fact/Chart.js
··· 194 194 var d_y = dd.getFullYear(); 195 195 196 196 // NOTE: Javascript months are zero-based. See PHI1017. 197 - var d_m = dd.getMonth() + 1; 197 + var d_m = (dd.getMonth() + 1).toString(); 198 + if (d_m.length == 1) { 199 + d_m = '0' + d_m; 200 + } 198 201 199 - var d_d = dd.getDate(); 202 + var d_d = dd.getDate().toString(); 203 + if (d_d.length == 1) { 204 + d_d = '0' + d_d; 205 + } 200 206 201 207 var y = parseInt(d.y1); 202 208