OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
import { Controller } from '@hotwired/stimulus';
import { formatElapsedTime } from 'core-app/features/work-packages/components/wp-timer-button/time-formatter.helper';
export default class MyTimersController extends Controller {
static values = {
start: String,
};
static targets = [
'elapsedTime',
];
declare readonly elapsedTimeTarget:HTMLElement;
declare readonly startValue:string;
connect() {
super.connect();
this.elapsedTimeTarget.textContent = 'Loading timer...';
this.timer(this.startValue);
}
timer(value:string|null|undefined) {
setInterval(() => {
this.elapsedTimeTarget.textContent = formatElapsedTime(value as string);
}, 1000);
}
}