Skip to content

Commit

Permalink
Merge pull request #189 from lucassabreu/bugfix/clone-wrong-date
Browse files Browse the repository at this point in the history
fix: clone was using start time of the cloned
  • Loading branch information
lucassabreu authored May 10, 2022
2 parents 2814a21 + 1a36e6f commit 69e7bca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions cmd/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,25 @@ 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,
)
},
getAllowNameForIDsFn(c),
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
Expand Down

0 comments on commit 69e7bca

Please sign in to comment.