You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by robertkowalski <gi...@git.apache.org> on 2014/04/13 14:00:38 UTC

[GitHub] couchdb pull request: Fauxton: fix missing leading zeros in logs

GitHub user robertkowalski opened a pull request:

    https://github.com/apache/couchdb/pull/208

    Fauxton: fix missing leading zeros in logs

    This adds leading zeros to the times in the log view. Before that
    the times were displayed like 1:5:3 (if it were 01:05:03)
    because getHours() and friends are returning a Number and not
    a String with a leading 0. In the case of 1:5:3 the corrected
    time is now displayed as: 01:05:03

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/robertkowalski/couchdb logs-leading-zeros

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb/pull/208.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #208
    
----
commit c0a6c727bf6fe0cba5d16b4cbd9b453ca8f8e72f
Author: Robert Kowalski <ro...@kowalski.gd>
Date:   2014-04-13T11:48:00Z

    Fauxton: fix missing leading zeros in logs
    
    This adds leading zeros to the times in the log view. Before that
    the times were displayed like 1:5:3 (if it were 01:05:03)
    because getHours() and friends are returning a Number and not
    a String with a leading 0. In the case of 1:5:3 the corrected
    time is now displayed as: 01:05:03

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb pull request: Fauxton: fix missing leading zeros in logs

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski commented on a diff in the pull request:

    https://github.com/apache/couchdb/pull/208#discussion_r11566707
  
    --- Diff: src/fauxton/app/addons/logs/resources.js ---
    @@ -23,12 +23,22 @@ function (app, FauxtonAPI, Backbone) {
       Log.Model = Backbone.Model.extend({
     
         date: function () {
    -      var date = new Date(this.get('date'));
    +      var date = new Date(this.get('date')),
    +          formattedTime,
    +          formattedDate;
     
    -      var formatted_time = date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
    -      var formatted_date = date.toDateString().slice(4, 10);
    +      function addLeadingZeros (part) {
    --- End diff --
    
    Awesome idea! Changed that!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb pull request: Fauxton: fix missing leading zeros in logs

Posted by robertkowalski <gi...@git.apache.org>.
Github user robertkowalski closed the pull request at:

    https://github.com/apache/couchdb/pull/208


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb pull request: Fauxton: fix missing leading zeros in logs

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb/pull/208#discussion_r11565945
  
    --- Diff: src/fauxton/app/addons/logs/resources.js ---
    @@ -23,12 +23,22 @@ function (app, FauxtonAPI, Backbone) {
       Log.Model = Backbone.Model.extend({
     
         date: function () {
    -      var date = new Date(this.get('date'));
    +      var date = new Date(this.get('date')),
    +          formattedTime,
    +          formattedDate;
     
    -      var formatted_time = date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
    -      var formatted_date = date.toDateString().slice(4, 10);
    +      function addLeadingZeros (part) {
    --- End diff --
    
    This looks good, as another option. Could we not use `d3.timeFormat`? https://github.com/mbostock/d3/wiki/Time-Formatting


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb pull request: Fauxton: fix missing leading zeros in logs

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on the pull request:

    https://github.com/apache/couchdb/pull/208#issuecomment-40338143
  
    Thanks @robertkowalski, I have merged it. You can close this PR. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---