fix daylight saving time is not calculated correctly when checking whether a transaction can be edited
This commit is contained in:
@@ -414,6 +414,12 @@ func GetTransactionTimeRangeByYearMonth(year int32, month int32) (int64, int64,
|
||||
return minTransactionTime, maxTransactionTime, nil
|
||||
}
|
||||
|
||||
// GetStartOfDay returns the start time of the day for the specified time
|
||||
func GetStartOfDay(t time.Time) time.Time {
|
||||
year, month, day := t.Date()
|
||||
return time.Date(year, month, day, 0, 0, 0, 0, t.Location())
|
||||
}
|
||||
|
||||
// parseFromUnixTime parses a unix time and returns a golang time struct
|
||||
func parseFromUnixTime(unixTime int64) time.Time {
|
||||
return time.Unix(unixTime, 0)
|
||||
|
||||
Reference in New Issue
Block a user