diff --git a/app/javascript/controllers/index.js b/app/javascript/controllers/index.js index 19d1d91..f13bc87 100644 --- a/app/javascript/controllers/index.js +++ b/app/javascript/controllers/index.js @@ -6,7 +6,7 @@ import { application } from "controllers/application" import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading" eagerLoadControllersFrom("controllers", application) -import { Popover } from "tailwindcss-stimulus-components" +import Popover from 'stimulus-popover' application.register('popover', Popover) // Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!) diff --git a/app/models/attendance.rb b/app/models/attendance.rb index b822bc7..c7647af 100644 --- a/app/models/attendance.rb +++ b/app/models/attendance.rb @@ -5,4 +5,9 @@ class Attendance < ApplicationRecord :concurrent, :catchup ] + + def duration + toggl_data['time_entries'].sum { |entry| entry['seconds'] } + .seconds + end end diff --git a/app/views/attendance_tracker/index.html.erb b/app/views/attendance_tracker/index.html.erb index 48f3b6a..82bc029 100644 --- a/app/views/attendance_tracker/index.html.erb +++ b/app/views/attendance_tracker/index.html.erb @@ -58,8 +58,8 @@