]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/Result.php
discord result command
[alttp.git] / app / Models / Result.php
index 308b9e9fcfd2e8935b25a46df87a39e4d991f8b5..99f3791eacfc951acabb8d69d22053f592adbc80 100644 (file)
@@ -11,6 +11,13 @@ class Result extends Model
        use HasFactory;
 
 
+       public function formatTime() {
+               $hours = floor($this->time / 60 / 60);
+               $minutes = floor(($this->time / 60) % 60);
+               $seconds = floor($this->time % 60);
+               return sprintf('%d:%02d:%02d', $hours, $minutes, $seconds);
+       }
+
        public function updateResult($time, $forfeit) {
                $this->time = $time;
                $this->forfeit = $forfeit;