Projeto bot pontos

This commit is contained in:
2026-10-23 22:31:02 -03:00
parent 29614855ff
commit b35e1a7d69
116 changed files with 14523 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
package rules
import (
"fmt"
"time"
)
// FormatMinutes formata uma duração de jornada: 480 → "8h00", 390 → "6h30".
func FormatMinutes(minutes int) string {
return fmt.Sprintf("%dh%02d", minutes/60, minutes%60)
}
// FormatMinutesShort formata intervalos curtos: 15 → "15 min", 60 → "1h00".
func FormatMinutesShort(minutes int) string {
if minutes < 60 {
return fmt.Sprintf("%d min", minutes)
}
return FormatMinutes(minutes)
}
// FormatClock formata o horário no fuso informado: "13:02".
func FormatClock(t time.Time, loc *time.Location) string {
return t.In(loc).Format("15:04")
}