You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2018/10/11 15:14:44 UTC

[GitHub] milleruntime commented on a change in pull request #688: Cleanup Monitor log page

milleruntime commented on a change in pull request #688: Cleanup Monitor log page
URL: https://github.com/apache/accumulo/pull/688#discussion_r224489496
 
 

 ##########
 File path: server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js
 ##########
 @@ -118,9 +118,12 @@ function bigNumber(big, suffixes, base) {
  * Formats the timestamp nicely
  */
 function dateFormat(timestamp) {
-   var date = new Date(timestamp);
-   date.toLocaleString().split(' ').join('&nbsp;');
-   return date;
+   var d = new Date(timestamp);
+   var day = d.getDate();
+   var month = d.getMonth() + 1;
+   var year = d.getFullYear();
+   var dateStr = "" + year + "-" + month + "-" + day + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds() + "," + d.getMilliseconds();
+   return dateStr;
 
 Review comment:
   Yeah I agree.  I can pull these changes out into another request.  But the problem I was seeing was that I didn't notice any difference in the dates display between just `new Date()` or ` date.toLocaleString()` or `date.toLocaleDateString()`.  It could have just been Chrome though since that was the only browser I tried it in. I also didn't want to have to import a new js library just to format one date but if we want anything else we might have to.  We can discuss more in another PR.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services