mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
#632 fix display value widget for dates
This commit is contained in:
parent
c1a78e8c5f
commit
602ec635c2
@ -22,6 +22,7 @@ import { FormService } from '../../../services/form.service';
|
|||||||
import { FormFieldOption } from './../core/form-field-option';
|
import { FormFieldOption } from './../core/form-field-option';
|
||||||
|
|
||||||
declare var componentHandler;
|
declare var componentHandler;
|
||||||
|
declare var moment: any;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
moduleId: module.id,
|
moduleId: module.id,
|
||||||
@ -84,6 +85,14 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit {
|
|||||||
this.loadRadioButtonValue();
|
this.loadRadioButtonValue();
|
||||||
}
|
}
|
||||||
break;
|
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:
|
default:
|
||||||
this.value = this.field.value;
|
this.value = this.field.value;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user