Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19640#discussion_r151186737
  
    --- Diff: core/src/main/resources/org/apache/spark/ui/static/utils.js ---
    @@ -46,3 +46,29 @@ function formatBytes(bytes, type) {
         var i = Math.floor(Math.log(bytes) / Math.log(k));
         return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + 
sizes[i];
     }
    +
    +function padZeroes(num) {
    +  return ("0" + num).slice(-2);
    +}
    +
    +function formatTimeMillis(timeMillis) {
    +  if (timeMillis <= 0) {
    +    return "-";
    +  } else {
    +    var dt = new Date(timeMillis);
    +    return dt.getFullYear() + "-" +
    +      padZeroes(dt.getMonth() + 1) + "-" +
    +      padZeroes(dt.getDate()) + " " +
    +      padZeroes(dt.getHours()) + ":" +
    +      padZeroes(dt.getMinutes()) + ":" +
    +      padZeroes(dt.getSeconds());
    +  }
    +}
    +
    +function getTimeZone() {
    +  try {
    +    return Intl.DateTimeFormat().resolvedOptions().timeZone;
    +  } catch(ex) {
    +    return new Date().toString().match(/\((.*)\)/)[1];
    --- End diff --
    
    if you really want to keep this code, please add comment to explain this 
regex.


---

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

Reply via email to