Explorar o código

format time in smsBatch

tripeur %!s(int64=2) %!d(string=hai) anos
pai
achega
705dbf0091
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/api/endpoints/project.py

+ 2 - 2
app/api/endpoints/project.py

@@ -143,8 +143,8 @@ async def create_sms_batch(
         slot_content = (
             sms_batch.template.replace("{titre}", slot.title)
             .replace("{description}", slot.description)
-            .replace("{debut}", str(slot.starting_time))
-            .replace("{fin}", str(slot.ending_time))
+            .replace("{debut}", slot.starting_time.strftime("%Hh%M"))
+            .replace("{fin}", slot.ending_time.strftime("%Hh%M"))
         )
         sending_time = slot.starting_time - timedelta(minutes=sms_batch.delta_t)
         for volunteer in slot.volunteers: