From 938614fafa8f65c8959cd28cc6a5861c55d940e4 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Sat, 16 Dec 2023 15:47:03 +0800 Subject: [PATCH] Format last updated field properly to add space between actual time and AM/PM indicator --- equipment_tracker/equipments/serializers.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/equipment_tracker/equipments/serializers.py b/equipment_tracker/equipments/serializers.py index f63598e..4d11259 100644 --- a/equipment_tracker/equipments/serializers.py +++ b/equipment_tracker/equipments/serializers.py @@ -16,9 +16,9 @@ class EquipmentHistoricalRecordField(serializers.ListField): class EquipmentSerializer(serializers.HyperlinkedModelSerializer): date_added = serializers.DateTimeField( - format="%m-%d-%Y %I:%M%p", read_only=True) + format="%m-%d-%Y %I:%M %p", read_only=True) last_updated = serializers.DateTimeField( - format="%m-%d-%Y %I:%M%p", read_only=True) + format="%m-%d-%Y %I:%M %p", read_only=True) last_updated_by = serializers.SerializerMethodField() name = serializers.CharField() description = serializers.CharField( @@ -67,7 +67,7 @@ class EquipmentSerializer(serializers.HyperlinkedModelSerializer): class EquipmentLogsSerializer(serializers.HyperlinkedModelSerializer): history_date = serializers.DateTimeField( - format="%m-%d-%Y %I:%M%p", read_only=True) + format="%m-%d-%Y %I:%M %p", read_only=True) history_user = serializers.SerializerMethodField() class Meta: @@ -84,9 +84,9 @@ class EquipmentLogsSerializer(serializers.HyperlinkedModelSerializer): class EquipmentLogSerializer(serializers.HyperlinkedModelSerializer): date_added = serializers.DateTimeField( - format="%m-%d-%Y %I:%M%p", read_only=True) + format="%m-%d-%Y %I:%M %p", read_only=True) last_updated = serializers.DateTimeField( - format="%m-%d-%Y %I:%M%p", read_only=True) + format="%m-%d-%Y %I:%M %p", read_only=True) last_updated_by = serializers.SerializerMethodField() name = serializers.CharField() description = serializers.CharField(required=False) @@ -126,9 +126,9 @@ class EquipmentInstanceSerializer(serializers.HyperlinkedModelSerializer): remarks = serializers.CharField( max_length=512, required=False, allow_blank=True) date_added = serializers.DateTimeField( - format="%m-%d-%Y %I:%M%p", read_only=True) + format="%m-%d-%Y %I:%M %p", read_only=True) last_updated = serializers.DateTimeField( - format="%m-%d-%Y %I:%M%p", read_only=True) + format="%m-%d-%Y %I:%M %p", read_only=True) last_updated_by = serializers.SerializerMethodField() status = serializers.ChoiceField( choices=EquipmentInstance.EQUIPMENT_INSTANCE_STATUS_CHOICES) @@ -202,7 +202,7 @@ class EquipmentInstanceSerializer(serializers.HyperlinkedModelSerializer): class EquipmentInstanceLogsSerializer(serializers.HyperlinkedModelSerializer): history_date = serializers.DateTimeField( - format="%m-%d-%Y %I:%M%p", read_only=True) + format="%m-%d-%Y %I:%M %p", read_only=True) history_user = serializers.SerializerMethodField() equipment = serializers.SlugRelatedField( slug_field='id', queryset=Equipment.objects.all()) @@ -231,9 +231,9 @@ class EquipmentInstanceLogSerializer(serializers.HyperlinkedModelSerializer): status = serializers.CharField() remarks = serializers.CharField() date_added = serializers.DateTimeField( - format="%m-%d-%Y %I:%M%p", read_only=True) + format="%m-%d-%Y %I:%M %p", read_only=True) last_updated = serializers.DateTimeField( - format="%m-%d-%Y %I:%M%p", read_only=True) + format="%m-%d-%Y %I:%M %p", read_only=True) last_updated_by = serializers.SerializerMethodField() history = EquipmentInstanceHistoricalRecordField() category = serializers.CharField(