Merge pull request #1004 from Alfresco/dev-denys-944

fix date formatting for completed forms
This commit is contained in:
Eugenio Romano
2016-11-04 14:33:04 +00:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -624,7 +624,7 @@ describe('DisplayValueWidget', () => {
let row = <DynamicTableRow> { value: { key: value } }; let row = <DynamicTableRow> { value: { key: value } };
let column = <DynamicTableColumn> { id: 'key', type: 'Date' }; let column = <DynamicTableColumn> { id: 'key', type: 'Date' };
expect(widget.getCellValue(row, column)).toBe('04-10-2016'); expect(widget.getCellValue(row, column)).toBe('4-10-2016');
}); });
it('should fallback to empty cell value for date', () => { it('should fallback to empty cell value for date', () => {

View File

@@ -176,7 +176,7 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
if (column.type === 'Date') { if (column.type === 'Date') {
if (result) { if (result) {
return moment(result.split('T')[0], 'YYYY-MM-DD').format('DD-MM-YYYY'); return moment(result.split('T')[0], 'YYYY-MM-DD').format('D-M-YYYY');
} }
} }