Ngx-bootstrap: it can be possible to use datepicker without input field. use only with icon?

Created on 27 Jun 2018  路  3Comments  路  Source: valor-software/ngx-bootstrap

it can be possible to use datepicker without input field. just click on the icon and then select a date and got date selection event

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: ^3.0.1

Angular: 6.0.6

Bootstrap: ^4.1.1

Build system: Angular CLI,

All 3 comments

yes possible with #dp="bsDatepicker" (bsValueChange)="onShown($event)">

Thanks

Hi @ShaileshInfyom, how can I pass the current value for the datepicker? With an input, a [(ngModel)] does the job, but I can't use that without an input.

Thanks!

Here's a more complete example:

<!-- Button to open calendar -->
<button type="button" (click)="d.toggle()">
    Open Calendar
</button>
<!-- Calendar -->
<span bsDatepicker
#d="bsDatepicker"
placement="right"            <!-- config inline -->
[bsConfig]="dateConfig"  <!-- config stored in component variable-->
[bsValue]="date"               <!-- initial value-->
(bsValueChange)="onShown($event)"></span>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

phmello picture phmello  路  3Comments

MihaiHoriaPopescu picture MihaiHoriaPopescu  路  3Comments

tpiros picture tpiros  路  3Comments

mounthorse-slns picture mounthorse-slns  路  3Comments

juanitavollmering picture juanitavollmering  路  3Comments