Skip to content

Commit d451d3b

Browse files
committed
Fix estimated delivery time frame.
1 parent 00429d9 commit d451d3b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ShipmentHandler.fs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ module ShipmentHandler =
2929
let private checkShipmentDate (timestamp: string) : bool =
3030
(timestamp |> System.DateTime.Parse |> System.DateTime.Now.Subtract |> _.Days) > DaysAfterDelivery
3131

32+
let private dateTimeStringToTimeOnly (dateTime: string) =
33+
dateTime |> System.DateTime.Parse |> System.TimeOnly.FromDateTime
34+
3235
let printShipmentLine (idx: int) (number: string) (shipment: DhlSchema.supermodelIoLogisticsTrackingShipment) =
3336
if
3437
shipment.Status.Timestamp.ToString() |> checkShipmentDate
@@ -50,7 +53,7 @@ module ShipmentHandler =
5053
let timeFrame =
5154
match shipment.EstimatedDeliveryTimeFrame with
5255
| null -> ""
53-
| tf -> $" / {System.DateTime.Parse(tf.ToString())}"
56+
| tf -> $" ({tf.EstimatedFrom.ToString() |> dateTimeStringToTimeOnly}-{tf.EstimatedThrough.ToString() |> dateTimeStringToTimeOnly})"
5457

5558
let deliveryRemark =
5659
match shipment.EstimatedTimeOfDeliveryRemark with

0 commit comments

Comments
 (0)