From 5c8a99675d327714a02b81563372a03e7d4ac614 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Thu, 21 Dec 2023 15:23:28 +0800 Subject: [PATCH] Format timestamp properly for transaction --- equipment_tracker/transactions/serializers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/equipment_tracker/transactions/serializers.py b/equipment_tracker/transactions/serializers.py index f9c2668..3aca4d3 100644 --- a/equipment_tracker/transactions/serializers.py +++ b/equipment_tracker/transactions/serializers.py @@ -30,6 +30,8 @@ class TransactionSerializer(serializers.HyperlinkedModelSerializer): many=False, slug_field='id', queryset=CustomUser.objects.all(), required=True, allow_null=False) equipments = serializers.SlugRelatedField( many=True, slug_field='id', queryset=EquipmentInstance.objects.all(), required=True) + timestamp = serializers.DateTimeField( + format="%m-%d-%Y %I:%M %p", read_only=True) transaction_status = serializers.ChoiceField( choices=Transaction.TRANSACTION_STATUS_CHOICES)