Github user wangyum commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19640#discussion_r150538938
  
    --- Diff: core/src/main/resources/org/apache/spark/ui/static/historypage.js 
---
    @@ -38,8 +38,17 @@ function makeIdNumeric(id) {
     }
     
     function formatDate(date) {
    -  if (date <= 0) return "-";
    -  else return date.split(".")[0].replace("T", " ");
    +  if (date <= 0) {
    +    return "-";
    +  } else {
    +    var dt = new Date(date);
    +    return dt.getFullYear() + "-" +
    +      ("0" + (dt.getMonth() + 1)).slice(-2) + "-" +
    --- End diff --
    
    How about this:
    ```javascript
    function formatDate(date) {
      if (date <= 0) {
        return "-";
      } else {
        var dt = new Date(date);
        return dt.getFullYear() + "-" +
          (dt.getMonth() + 1).toString().padStart(2, "0") + "-" +
          (dt.getDate()).toString().padStart(2, "0") + " " +
          (dt.getHours()).toString().padStart(2, "0") + ":" +
          (dt.getMinutes()).toString().padStart(2, "0") + ":" +
          (dt.getSeconds()).toString().padStart(2, "0");
      }
    }
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to