package transform

import (
	"time"

	"gordenko.dev/dima/qb/timeutil"
)

func groupByHour(timestamp uint32) time.Time {
	return timeutil.FirstSecondInPeriod(time.Unix(int64(timestamp), 0), "h")
}

func groupByDay(timestamp uint32) time.Time {
	return timeutil.FirstSecondInPeriod(time.Unix(int64(timestamp), 0), "d")
}

func groupByMonth(timestamp uint32) time.Time {
	return timeutil.FirstSecondInPeriod(time.Unix(int64(timestamp), 0), "m")
}
