Skip to content

Commit

Permalink
remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
sfwn committed Oct 10, 2023
1 parent fd5bf48 commit 79a3624
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ func decodeMapToIssueSheetModel(data *vars.DataForFulfill, m map[IssueSheetColum
case fieldAssigneeName:
model.Common.AssigneeName = cell.Value
case fieldCreatedAt:
model.Common.CreatedAt = vars.MustParseStringTime(cell.Value, groupField)
model.Common.CreatedAt = mustParseStringTime(cell.Value, groupField)
case fieldPlanStartedAt:
model.Common.PlanStartedAt = vars.MustParseStringTime(cell.Value, groupField)
model.Common.PlanStartedAt = mustParseStringTime(cell.Value, groupField)
case fieldPlanFinishedAt:
model.Common.PlanFinishedAt = vars.MustParseStringTime(cell.Value, groupField)
model.Common.PlanFinishedAt = mustParseStringTime(cell.Value, groupField)
case fieldStartAt:
model.Common.StartAt = vars.MustParseStringTime(cell.Value, groupField)
model.Common.StartAt = mustParseStringTime(cell.Value, groupField)
case fieldFinishAt:
model.Common.FinishAt = vars.MustParseStringTime(cell.Value, groupField)
model.Common.FinishAt = mustParseStringTime(cell.Value, groupField)
case fieldEstimateTime:
model.Common.EstimateTime = cell.Value
case fieldLabels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,6 @@ import (
"github.com/erda-project/erda/pkg/strutil"
)

func ParseStringTime(s string) (*time.Time, error) {
if s == "" {
return nil, nil
}
t, err := time.ParseInLocation("2006-01-02 15:04:05", s, time.Local)
if err != nil {
return nil, err
}
return &t, nil
}

func MustParseStringTime(s string, typ string) *time.Time {
t, err := ParseStringTime(s)
if err != nil {
panic(fmt.Sprintf("invalid %s time: %s, err: %v", typ, s, err))
}
return t
}

func ParseStringSliceByComma(s string) []string {
results := strutil.Splits(s, []string{",", ","}, true)
// trim space
Expand Down
1 change: 0 additions & 1 deletion pkg/excel/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ func DecodeToSheets(r io.Reader) (DecodedFile, error) {
})

s := NewSheet(sheet)
//s.UnmergedSlice = fileUnmergedSlice[i]

sheets.L = append(sheets.L, s)
sheets.M[sheet.Name] = s
Expand Down

0 comments on commit 79a3624

Please sign in to comment.