mirror of
https://github.com/celogeek/piwigo-cli.git
synced 2025-05-25 02:02:37 +02:00
remove reserved word
This commit is contained in:
parent
9e64227494
commit
a9254b7977
@ -45,7 +45,7 @@ func (c TimeResult) toTime() time.Time {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c TimeResult) AgeAt(createdAt *TimeResult) string {
|
func (c TimeResult) AgeAt(createdAt *TimeResult) string {
|
||||||
var year, month, day, hour, min, sec int
|
var year, month, day, hour, minutes, seconds int
|
||||||
a := c.toTime()
|
a := c.toTime()
|
||||||
if a.IsZero() {
|
if a.IsZero() {
|
||||||
return ""
|
return ""
|
||||||
@ -67,20 +67,20 @@ func (c TimeResult) AgeAt(createdAt *TimeResult) string {
|
|||||||
h1, m1, s1 := a.Clock()
|
h1, m1, s1 := a.Clock()
|
||||||
h2, m2, s2 := b.Clock()
|
h2, m2, s2 := b.Clock()
|
||||||
|
|
||||||
year = int(y2 - y1)
|
year = y2 - y1
|
||||||
month = int(M2 - M1)
|
month = int(M2 - M1)
|
||||||
day = int(d2 - d1)
|
day = d2 - d1
|
||||||
hour = int(h2 - h1)
|
hour = h2 - h1
|
||||||
min = int(m2 - m1)
|
minutes = m2 - m1
|
||||||
sec = int(s2 - s1)
|
seconds = s2 - s1
|
||||||
|
|
||||||
// Normalize negative values
|
// Normalize negative values
|
||||||
if sec < 0 {
|
if seconds < 0 {
|
||||||
sec += 60
|
seconds += 60
|
||||||
min--
|
minutes--
|
||||||
}
|
}
|
||||||
if min < 0 {
|
if minutes < 0 {
|
||||||
min += 60
|
minutes += 60
|
||||||
hour--
|
hour--
|
||||||
}
|
}
|
||||||
if hour < 0 {
|
if hour < 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user