Fixed date utils and added typeDoc/comments

This commit is contained in:
Giuseppe Digilio
2019-02-18 13:30:34 +01:00
parent dc6709c2b5
commit 18eaef3c2b
4 changed files with 49 additions and 17 deletions

View File

@@ -28,7 +28,7 @@ import {
import { DynamicRowArrayModel } from './ds-dynamic-form-ui/models/ds-dynamic-row-array-model';
import { DsDynamicInputModel } from './ds-dynamic-form-ui/models/ds-dynamic-input.model';
import { FormFieldMetadataValueObject } from './models/form-field-metadata-value.model';
import { isDateObject } from '../../date.util';
import { isNgbDateStruct } from '../../date.util';
@Injectable()
export class FormBuilderService extends DynamicFormService {
@@ -109,7 +109,7 @@ export class FormBuilderService extends DynamicFormService {
} else if (isObject(controlValue)) {
const authority = controlValue.authority || controlValue.id || null;
const place = controlModelIndex || controlValue.place;
if (isDateObject(controlValue)) {
if (isNgbDateStruct(controlValue)) {
return new FormFieldMetadataValueObject(controlValue, controlLanguage, authority, controlValue, place);
} else {
return new FormFieldMetadataValueObject(controlValue.value, controlLanguage, authority, controlValue.display, place, controlValue.confidence);