diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a816d9e..7559e6c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- `clone` command was using the start time of the copied time entry to close the current one + instead of the start time of new one being created. + ## [v0.36.0] - 2022-05-09 ### Added diff --git a/cmd/clone.go b/cmd/clone.go index a031410f..5d8093a3 100644 --- a/cmd/clone.go +++ b/cmd/clone.go @@ -64,12 +64,12 @@ var cloneCmd = &cobra.Command{ if tec, err = manageEntry( tec, fillTimeEntryWithFlags(cmd.Flags()), - func(tei dto.TimeEntryImpl) (dto.TimeEntryImpl, error) { + func(tec dto.TimeEntryImpl) (dto.TimeEntryImpl, error) { if noClosing { - return tei, nil + return tec, nil } - return tei, validateClosingTimeEntry( + return tec, validateClosingTimeEntry( c, tec.WorkspaceID, tec.UserID, ) }, @@ -77,12 +77,12 @@ var cloneCmd = &cobra.Command{ getPropsInteractiveFn(c, dc), getDatesInteractiveFn(), getValidateTimeEntryFn(c), - func(tei dto.TimeEntryImpl) (dto.TimeEntryImpl, error) { + func(tec dto.TimeEntryImpl) (dto.TimeEntryImpl, error) { if noClosing { - return tei, nil + return tec, nil } - return tei, out(tec, c) + return tec, out(tec, c) }, ); err != nil { return err