ng2-datepicker icon indicating copy to clipboard operation
ng2-datepicker copied to clipboard

Options are ignored when custom input is used

Open irynaslisava opened this issue 7 years ago • 4 comments

Options are ignored when I add [headless]="true"

datePickerOptions: DatepickerOptions = { displayFormat: 'DD.MM.YYYY', barTitleFormat: 'MMMM YYYY', dayNamesFormat: 'dd', firstCalendarDay: 0, // 0 - Sunday, 1 - Monday locale: frLocale, minDate: new Date(this.availableFromDateData.getMinValue()), maxDate: new Date(this.availableFromDateData.getMaxValue()) };

<input type="text" name="date" [(ngModel)]="date" (click)="picker1.toggle()"/> <ng-datepicker [headless]="true" #picker1 [(ngModel)]="date" [options]="datePickerOptions">

irynaslisava avatar Feb 07 '18 08:02 irynaslisava

i’ll check in a few minutes.

On 7 February 2018 at 09:12:20, irynaslisava ([email protected]) wrote:

Options are ignored when I add [headless]="true"

datePickerOptions: DatepickerOptions = { displayFormat: 'DD.MM.YYYY', barTitleFormat: 'MMMM YYYY', dayNamesFormat: 'dd', firstCalendarDay: 0, // 0 - Sunday, 1 - Monday locale: frLocale, minDate: new Date(this.availableFromDateData.getMinValue()), maxDate: new Date(this.availableFromDateData.getMaxValue()) };

<input type="text" name="date" [(ngModel)]="date" (click)="picker1.toggle()"/> <ng-datepicker [headless]="true" #picker1 [(ngModel)]="date" [options]="datePickerOptions">

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bleenco/ng2-datepicker/issues/304, or mute the thread https://github.com/notifications/unsubscribe-auth/ABtntjTFugna5jUuNfqD_F9WIR9v4qeyks5tSVrkgaJpZM4R8TFR .

jkuri avatar Feb 07 '18 09:02 jkuri

why would you like to use custom input and not just change the style of existing one if needed?

jkuri avatar Feb 07 '18 18:02 jkuri

I need datepicker enabled for both to choose date in calendar-dropdown or via manual entry.

irynaslisava avatar Feb 08 '18 08:02 irynaslisava

@irynaslisava did you try set any dummy name attribute to ng-datepicker? In case of version 2.2.5 there is no problem.

aemini avatar Apr 03 '18 18:04 aemini