diff --git a/projects/ngx-formentry/src/components/ngx-datetime-picker/ngx-datetime-picker.component.ts b/projects/ngx-formentry/src/components/ngx-datetime-picker/ngx-datetime-picker.component.ts index 90816a00..aa0ccafb 100644 --- a/projects/ngx-formentry/src/components/ngx-datetime-picker/ngx-datetime-picker.component.ts +++ b/projects/ngx-formentry/src/components/ngx-datetime-picker/ngx-datetime-picker.component.ts @@ -53,4 +53,14 @@ export class NgxDatetimeComponent implements ControlValueAccessor { const currentDate: string = new Date().toString(); this.onInput({ value: moment(currentDate).add(numberOfWeeks, 'weeks') }); } + + getPlaceholderValue(): string { + if (this.datePickerFormat === 'both') { + return 'dd/mm/yyyy hh:mm'; + } else if (this.datePickerFormat === 'timer') { + return 'hh:mm'; + } else { + return 'dd/mm/yyyy'; + } + } } diff --git a/projects/ngx-formentry/src/components/ngx-datetime-picker/ngx-datetime-picker.html b/projects/ngx-formentry/src/components/ngx-datetime-picker/ngx-datetime-picker.html index 59f7a595..85096f0e 100644 --- a/projects/ngx-formentry/src/components/ngx-datetime-picker/ngx-datetime-picker.html +++ b/projects/ngx-formentry/src/components/ngx-datetime-picker/ngx-datetime-picker.html @@ -18,7 +18,7 @@ [value]="value" [owlDateTime]="dt1" [ofeOwlDateTimeTrigger]="dt1" - placeholder="mm/dd/yyyy" + placeholder="{{getPlaceholderValue()}}" data-date-picker-input />