F
Filament9mo ago
Emaz

timer plugin?

Anyone know of a timer plugin? I don't see any. I wish I had the time to do one but I probably don't. But what do you all think would be involved? I'd like to see models that have a cumulative_time field. Then in filament, 3 buttons: start timer, end timer and a save button. So start/end would accumulate time. When you finally hit save, it saves the data to the model. Or a simpler version - press start, then when you press end the time is saved. If this is easier than I think maybe I'd tackle it. But I'm not sure how this would be done.
Solution:
Should be fairly simple as a custom field. Alpine for the timer and just entangle the state.
Jump to solution
6 Replies
Solution
awcodes
awcodes9mo ago
Should be fairly simple as a custom field. Alpine for the timer and just entangle the state.
Emaz
Emaz9mo ago
Interesting. I built myself a simple ToDo list manager in Filament, which was SUPER easy and I just wanted time tracking as well. I'm guessing lots of Filament projects could use this. Don't know if I have the bandwidth but you got me thinking. LOL
awcodes
awcodes9mo ago
Won’t be much band width unless people use it and need new features. So go for it. If you build it right then there won’t be any bandwidth except for edge cases. But I don’t see too many edge cases here. Then it’s just a matter of worry about major filament updates. Only real difficulty I see would be that the end user would still have to save the form to persist the value. But I think there’s ways to also save the record when they hit “stop” on the timer.
Emaz
Emaz9mo ago
No description
Emaz
Emaz9mo ago
Not quite done yet but thanks for the encouragement. Also, the way I intend to use it is to just let the edit sit open. I'll stop the timer periodically, restart when I work on the task and let time accumulate. THEN save the record. But I'm open to suggestions. I'm going to include billing rates and use this for billing.
Milorn
Milorn5mo ago
Hi @Emaz, I hope you're doing well. Could you please share your code or the way you did it ? i'm trying to do the same but i'm kinda stuck
Want results from more Discord servers?
Add your server
More Posts