mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
#632 fix display value widget for dates
This commit is contained in:
@@ -22,6 +22,7 @@ import { FormService } from '../../../services/form.service';
|
||||
import { FormFieldOption } from './../core/form-field-option';
|
||||
|
||||
declare var componentHandler;
|
||||
declare var moment: any;
|
||||
|
||||
@Component({
|
||||
moduleId: module.id,
|
||||
@@ -84,6 +85,14 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
|
||||
this.loadRadioButtonValue();
|
||||
}
|
||||
break;
|
||||
case FormFieldTypes.DATE:
|
||||
if (this.value) {
|
||||
let d = moment(this.value.split('T')[0]);
|
||||
if (d.isValid()) {
|
||||
this.value = d.format('D-M-YYYY');
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
this.value = this.field.value;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user