Browse Source

added date formatting

php2python
Holger Frey 7 years ago
parent
commit
880416ade6
  1. 7
      ordr2/models/orders.py
  2. 2
      ordr2/templates/orders/delete.jinja2
  3. 2
      ordr2/templates/orders/edit_multiple_stati.jinja2
  4. 2
      ordr2/templates/orders/list.jinja2

7
ordr2/models/orders.py

@ -107,9 +107,12 @@ class Order(Base): @@ -107,9 +107,12 @@ class Order(Base):
return ''
if some_one:
# in the new system a status change also stores the purchaser
return '{!s} by {!s}'.format(some_date, some_one)
return '{!s} by {!s}'.format(
some_date.strftime('%Y-%m-%d %H:%M'),
some_one
)
# historical data does not have a purchaser associated with a date
return '{!s}'.format(some_date)
return '{!s}'.format(some_date.strftime('%Y-%m-%d %H:%M'))
@property
def placed(self):

2
ordr2/templates/orders/delete.jinja2

@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
<tr>
<td>
<input type="hidden" name="order" value="{{ order.id }}">
{{ order.created_date }}
{{ order.created_date.strftime('%Y-%m-%d %H:%M') }}
</td>
<td>{{ order.cas_description }} </td>
<td>{{ order.vendor }} </td>

2
ordr2/templates/orders/edit_multiple_stati.jinja2

@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
<tbody>
{% for order in orders %}
<tr>
<td>{{ order.created_date }}</td>
<td>{{ order.created_date.strftime('%Y-%m-%d %H:%M') }}</td>
<td>{{ order.cas_description }} </td>
<td>{{ order.vendor }} </td>
<td>{{ order.created_by }} </td>

2
ordr2/templates/orders/list.jinja2

@ -83,7 +83,7 @@ @@ -83,7 +83,7 @@
<input type="checkbox" name="marked" value="{{ order.model.id }}">
</td>
{% endif %}
<td class="column-created">{{ order.model.created_date }}</td>
<td class="column-created">{{ order.model.created_date.strftime('%Y-%m-%d %H:%M') }}</td>
<td class="column-cas">{{ order.model.cas_description }}</td>
<td class="column-vendor">{{ order.model.vendor }}</td>
<td class="column-catalog">{{ order.model.catalog_nr }}</td>