Browse Source

include year in date format for prire checker

Pi 2 years ago
parent
commit
d4eb219ffa
2 changed files with 2 additions and 2 deletions
  1. 1 1
      app/db_utils.py
  2. 1 1
      app/price_view.py

+ 1 - 1
app/db_utils.py

@@ -28,7 +28,7 @@ NON_IDENTIFIER_COLUMNS = [
 
 display_map = {
     'ts': lambda x: f"{time.strftime('%Y-%m-%d %H:%M', (x.year, x.month, x.day, x.hour, x.minute, 0, 0, 0, 0))}",
-    '%d/%m %_I%P': lambda x: f"{time.strftime('%d/%m %_I%P', (x.year, x.month, x.day, x.hour, x.minute, 0, 0, 0, 0))}",
+    '%d/%m/%y %_I%P': lambda x: f"{time.strftime('%d/%m/%y %_I%P', (x.year, x.month, x.day, x.hour, x.minute, 0, 0, 0, 0))}",
     'price': lambda x: f'{x:.4f}',
     'quantity': lambda x: f'{x:.2f}',
     'organic': lambda x: 'yes' if x else 'no',

+ 1 - 1
app/price_view.py

@@ -63,7 +63,7 @@ def get_historic_prices_statement(sort, product, unit, organic=None, limit='90 d
         #('ts', SQL('{identifier}::date').format(
         #    identifier=Identifier('ts'),
         #)),
-        ('%d/%m %_I%P', SQL("""(transactions.ts AT TIME ZONE 'UTC')::timestamp without time zone""")),
+        ('%d/%m/%y %_I%P', SQL("""(transactions.ts AT TIME ZONE 'UTC')::timestamp without time zone""")),
         #('store', Identifier('stores', 'name')),
         ('code', Identifier('stores', 'code')),
         #('description', Identifier('transactions','description')),