mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 09:15:26 +01:00 
			
		
		
		
	print times in local timezone (#217)
dont resolve location ahead of time fixup! use local timezone for all printed times fixup! use local timezone for all printed times use local timezone for all printed times Co-authored-by: Norwin Roosen <git@nroo.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/217 Reviewed-by: techknowlogick <techknowlogick@gitea.io> Reviewed-by: 6543 <6543@noreply.gitea.io>
This commit is contained in:
		| @@ -6,7 +6,6 @@ package print | ||||
|  | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"log" | ||||
| 	"strconv" | ||||
| 	"time" | ||||
|  | ||||
| @@ -27,11 +26,6 @@ func TrackedTimesList(times []*gitea.TrackedTime, outputType string, from, until | ||||
| 	var outputValues [][]string | ||||
| 	var totalDuration int64 | ||||
|  | ||||
| 	localLoc, err := time.LoadLocation("Local") // local timezone for time formatting | ||||
| 	if err != nil { | ||||
| 		log.Fatal(err) | ||||
| 	} | ||||
|  | ||||
| 	for _, t := range times { | ||||
| 		if !from.IsZero() && from.After(t.Created) { | ||||
| 			continue | ||||
| @@ -45,7 +39,7 @@ func TrackedTimesList(times []*gitea.TrackedTime, outputType string, from, until | ||||
| 		outputValues = append( | ||||
| 			outputValues, | ||||
| 			[]string{ | ||||
| 				t.Created.In(localLoc).Format("2006-01-02 15:04:05"), | ||||
| 				FormatTime(t.Created), | ||||
| 				"#" + strconv.FormatInt(t.Issue.Index, 10), | ||||
| 				t.UserName, | ||||
| 				formatDuration(t.Time, outputType), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Norwin
					Norwin