|
@@ -227,6 +227,16 @@ func (c CowSlice) ToPB(
|
|
|
lastCalvingAtFormat = time.Unix(v.LastCalvingAt, 0).Format(LayoutDate2)
|
|
|
}
|
|
|
|
|
|
+ lastAbortionAtFormat := ""
|
|
|
+ if v.LastAbortionAt > 0 {
|
|
|
+ lastAbortionAtFormat = time.Unix(v.LastAbortionAt, 0).Format(LayoutDate2)
|
|
|
+ }
|
|
|
+
|
|
|
+ lastSecondWeightAtFormat := ""
|
|
|
+ if v.LastSecondWeightAt > 0 {
|
|
|
+ lastSecondWeightAtFormat = time.Unix(v.LastSecondWeightAt, 0).Format(LayoutDate2)
|
|
|
+ }
|
|
|
+
|
|
|
res[i] = &pasturePb.CowDetails{
|
|
|
CowId: int32(v.Id),
|
|
|
Sex: sex,
|
|
@@ -258,7 +268,9 @@ func (c CowSlice) ToPB(
|
|
|
LastPregnantCheckAtFormat: lastPregnantCheckAtFormat,
|
|
|
LastWeightAtFormat: lastWeightAtFormat,
|
|
|
LastCalvingAtFormat: lastCalvingAtFormat,
|
|
|
- //PregnancyAge: v.PregnancyAge,
|
|
|
+ LastAbortionAtFormat: lastAbortionAtFormat,
|
|
|
+ LastSecondWeight: float32(v.LastSecondWeight) / 100,
|
|
|
+ LastSecondWeightAtFormat: lastSecondWeightAtFormat,
|
|
|
}
|
|
|
}
|
|
|
return res
|