From 97cbe13196a89f222d125b29d65a1f6bdcf7a663 Mon Sep 17 00:00:00 2001 From: Shiro-Nek0 Date: Mon, 22 Jun 2026 03:02:15 -0400 Subject: [PATCH] feat: configure Santiago timezone and split scheduled price datetime inputs --- docker-compose.yml | 1 + routes/admin_bp.py | 7 ++++--- templates/admin_productos.html | 9 ++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5ae63f6..d1da445 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,7 @@ services: environment: - FLASK_ENV=production - PYTHONUNBUFFERED=1 + - TZ=America/Santiago volumes: - /home/shironeko/Documents/dockerVols/rendiciones/db:/app/db - /home/shironeko/Documents/dockerVols/rendiciones/static/cache:/app/static/cache diff --git a/routes/admin_bp.py b/routes/admin_bp.py index e3aa227..9d198e5 100644 --- a/routes/admin_bp.py +++ b/routes/admin_bp.py @@ -386,9 +386,10 @@ def delete_product(id): @admin_bp.route('/productos/precios/', methods=['POST']) @admin_required def update_product_prices(id): - fecha_input = request.form.get('fecha_activacion') - if fecha_input: - fecha_activacion = datetime.strptime(fecha_input, '%Y-%m-%dT%H:%M').replace(second=0) + fecha_date = request.form.get('fecha_activacion_date') + fecha_time = request.form.get('fecha_activacion_time') or '00:00' + if fecha_date: + fecha_activacion = datetime.strptime(f"{fecha_date} {fecha_time}", '%Y-%m-%d %H:%M').replace(second=0) else: fecha_activacion = datetime.now() diff --git a/templates/admin_productos.html b/templates/admin_productos.html index d0184e1..e066b16 100644 --- a/templates/admin_productos.html +++ b/templates/admin_productos.html @@ -103,7 +103,14 @@ - +
+
+ +
+
+ +
+
Si lo dejas en blanco, el cambio se aplicará inmediatamente.