Merge branch 'master' of e.coding.net:rosydev/baseapi
This commit is contained in:
@@ -582,3 +582,21 @@ func TestGetStoreFreightDetail(t *testing.T) {
|
||||
fmt.Println(utils.Format4Output(detail, false))
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
func TestNew(t *testing.T) {
|
||||
opTimeList := []int16{800, 2030, 2100, 2300}
|
||||
timesLen := len(opTimeList) / 2 * 2
|
||||
var strPairs []string
|
||||
for i := 0; i < timesLen; i += 2 {
|
||||
if opTimeList[i] != 0 {
|
||||
strPairs = append(strPairs, JxOperationTime2StrTime(opTimeList[i])+"-"+JxOperationTime2StrTime(opTimeList[i+1]))
|
||||
} else {
|
||||
break
|
||||
}
|
||||
}
|
||||
fmt.Println(strings.Join(strPairs, ","))
|
||||
}
|
||||
|
||||
func JxOperationTime2StrTime(value int16) string {
|
||||
return fmt.Sprintf("%02d:%02d", value/100, value%100)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user