remind: Don't preserve seconds if not specified
This commit is contained in:
parent
a9acbe719e
commit
62106504ee
1 changed files with 2 additions and 2 deletions
|
@ -154,7 +154,7 @@ func parseDuration(date string) (time.Time, error) {
|
|||
switch {
|
||||
case isSscanfValid(fmt.Sscanf(date, "%d/%d/%d-%d:%d:%d", &day, &month, &year, &hour, &min, &sec)):
|
||||
case isSscanfValid(fmt.Sscanf(date, "%d/%d/%d-%d:%d", &day, &month, &year, &hour, &min)):
|
||||
sec = now.Second()
|
||||
sec = 0
|
||||
case isSscanfValid(fmt.Sscanf(date, "%d/%d/%d", &day, &month, &year)):
|
||||
hour = now.Hour()
|
||||
min = now.Minute()
|
||||
|
@ -167,7 +167,7 @@ func parseDuration(date string) (time.Time, error) {
|
|||
day = now.Day()
|
||||
month = now.Month()
|
||||
year = now.Year()
|
||||
sec = now.Second()
|
||||
sec = 0
|
||||
case isSscanfValid(fmt.Sscanf(date, "%d%c", &num, &sep)):
|
||||
dur := time.Duration(num)
|
||||
switch unicode.ToLower(sep) {
|
||||
|
|
Reference in a new issue