mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 19:15:41 +00:00
Changed tracking into to datetime field
- Added moment.js for formatting dates -
This commit is contained in:
20
InvenTree/stock/migrations/0003_auto_20180510_1042.py
Normal file
20
InvenTree/stock/migrations/0003_auto_20180510_1042.py
Normal file
@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.12 on 2018-05-10 10:42
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('stock', '0002_auto_20180430_1218'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='stockitemtracking',
|
||||
name='date',
|
||||
field=models.DateTimeField(auto_now_add=True),
|
||||
),
|
||||
]
|
@ -329,7 +329,7 @@ class StockItemTracking(models.Model):
|
||||
related_name='tracking_info')
|
||||
|
||||
# Date this entry was created (cannot be edited)
|
||||
date = models.DateField(auto_now_add=True, editable=False)
|
||||
date = models.DateTimeField(auto_now_add=True, editable=False)
|
||||
|
||||
# Short-form title for this tracking entry
|
||||
title = models.CharField(max_length=250)
|
||||
|
@ -186,6 +186,15 @@
|
||||
field: 'date',
|
||||
title: 'Date',
|
||||
sortable: true,
|
||||
formatter: function(value, row, index, field) {
|
||||
var m = moment(value);
|
||||
if (m.isValid()) {
|
||||
var html = m.format('dddd MMMM Do YYYY') + '<br>' + m.format('h:mm a');
|
||||
return html;
|
||||
}
|
||||
|
||||
return 'N/A';
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'title',
|
||||
|
Reference in New Issue
Block a user