Coder Social home page Coder Social logo

Comments (6)

meltyshev avatar meltyshev commented on August 27, 2024

Hello! Do you mean to show somewhere how much time has passed since the creation?

from planka.

gittbuh avatar gittbuh commented on August 27, 2024

Hi! No, in this case I meant that the application can show the sum of all/the total hours/minutes/seconds spent in all tasks (where the timer has been used) for each project at least and ideally for each board. That would be pretty useful for me as a means of measuring/visualizing total effort or time investment. I wonder how possible or difficult it is to implement here.

from planka.

oscadev avatar oscadev commented on August 27, 2024

This. We can click timers to start tracking time on a task, but there seems to be no way to see a total tally of all time spent on all tasks total in a project. This means I would have to manually add up the hours each time to know how many hours are left, if for example a client has paid for X number of hours.

from planka.

remy56k avatar remy56k commented on August 27, 2024

I'm looking for this feature too, it could be very useful !
I have wrote a workaround, client side (in the browser JavaScript console).
Just paste this little script and hit Enter when you are on your cards-board view.

// Select all span elements with class starting with "Stopwatch_wrapper*"
var allTimers = document.querySelectorAll('span[class^="Stopwatch_wrapper"]');
// Initialize a sum variable
var sumInSeconds = 0;
// Iterate through each timers and sum up their text content
allTimers.forEach(function(timer) {
    // Extract the text content
    var timeString = timer.textContent;
    // Parse the time string into hours, minutes, and seconds
    var timeParts = timeString.split(":");
    if (timeParts.length === 3) {
        var hours = parseInt(timeParts[0]);
        var minutes = parseInt(timeParts[1]);
        var seconds = parseInt(timeParts[2]);
        // Convert hours and minutes into seconds
        var totalTimeInSeconds = hours * 3600 + minutes * 60 + seconds;
        // Add to the sum
        sumInSeconds += totalTimeInSeconds;
    }
});
// Convert the total seconds back to the hh:mm:ss format
var hours = Math.floor(sumInSeconds / 3600);
var minutes = Math.floor((sumInSeconds % 3600) / 60);
var seconds = sumInSeconds % 60;
// Output your sum 
console.log("Total sum = " + hours + ":" + minutes + ":" + seconds);

The output is like : Total sum = 2:47:30

from planka.

oscadev avatar oscadev commented on August 27, 2024

I'm looking for this feature too, it could be very useful ! I have wrote a workaround, client side (in the browser JavaScript console). Just paste this little script and hit Enter when you are on your cards-board view.

// Select all span elements with class starting with "Stopwatch_wrapper*"
var allTimers = document.querySelectorAll('span[class^="Stopwatch_wrapper"]');
// Initialize a sum variable
var sumInSeconds = 0;
// Iterate through each timers and sum up their text content
allTimers.forEach(function(timer) {
    // Extract the text content
    var timeString = timer.textContent;
    // Parse the time string into hours, minutes, and seconds
    var timeParts = timeString.split(":");
    if (timeParts.length === 3) {
        var hours = parseInt(timeParts[0]);
        var minutes = parseInt(timeParts[1]);
        var seconds = parseInt(timeParts[2]);
        // Convert hours and minutes into seconds
        var totalTimeInSeconds = hours * 3600 + minutes * 60 + seconds;
        // Add to the sum
        sumInSeconds += totalTimeInSeconds;
    }
});
// Convert the total seconds back to the hh:mm:ss format
var hours = Math.floor(sumInSeconds / 3600);
var minutes = Math.floor((sumInSeconds % 3600) / 60);
var seconds = sumInSeconds % 60;
// Output your sum 
console.log("Total sum = " + hours + ":" + minutes + ":" + seconds);

The output is like : Total sum = 2:47:30

Thanks, but I think this wouldnt show an entire project's hours, and instead show all the hours inside one board, correct?

from planka.

remy56k avatar remy56k commented on August 27, 2024

Thanks, but I think this wouldnt show an entire project's hours, and instead show all the hours inside one board, correct?

Correct, it's the sum of all cards in the viewed tab, if you want a global sum for a project, just switch to the next tab, run the script, etc... and sum all results at end. Not perfect but better than nothing.

from planka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.