feat:#31 updated database start end to date

This commit is contained in:
masterelmar
2023-10-28 11:10:06 +02:00
parent d10343fe89
commit 7228d17d84
7 changed files with 667 additions and 33 deletions

View File

@@ -4,7 +4,8 @@ import "time"
func GetDateFromWeekNumber(year int, weekNumber int, dayName string) (time.Time, error) {
// Create a time.Date for the first day of the year
firstDayOfYear := time.Date(year, time.January, 1, 0, 0, 0, 0, time.UTC)
europeTime, _ := time.LoadLocation("Europe/Berlin")
firstDayOfYear := time.Date(year, time.January, 1, 0, 0, 0, 0, europeTime)
// Calculate the number of days to add to reach the desired week
daysToAdd := time.Duration((weekNumber-1)*7) * 24 * time.Hour