Skip to content

Commit

Permalink
cleanup: time/timeutil: remove unneeded code
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Sep 17, 2023
1 parent 445cedb commit e79a898
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions time/timeutil/duration_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,27 +149,6 @@ func ParseDurationInfoStrings(wk, dy, hr, mn, sc, ms, us, ns string) (DurationIn
return dur, nil
}

/*
// TotalNanoseconds returns the total number of nanoseconds represented by the duration.
func (di *DurationInfo) TotalNanoseconds() int64 {
return (di.Hours * NanosPerHour) +
(di.Minutes * NanosPerMinute) +
(di.Seconds * NanosPerSecond) +
(di.Milliseconds * NanosPerMillisecond) +
(di.Microseconds * NanosPerMicrosecond) +
di.Nanoseconds
}
// Duration returns a `time.Duration` struct representing the duration.
func (di *DurationInfo) Duration() time.Duration {
dur, err := time.ParseDuration(strconv.Itoa(int(di.TotalNanoseconds())) + "ns")
if err != nil {
panic(err)
}
return dur
}
*/

// Duration returns a `time.Duration` struct. Params for `hoursPerDay` and `daysPerWeek` are
// used for atlernate values such as working hours per day and working days per week, e.g.
// 8 hours per day and 5 days per week.
Expand Down

0 comments on commit e79a898

Please sign in to comment.