简体   繁体   English

ngx-Bootstrap 中的月份范围选择器

[英]Month range picker in ngx-Bootstrap

I'm using date-range picker of ngx bootstrap and it is working totally fine.我正在使用ngx bootstrap 的日期范围选择器,它工作正常。 But I want to use it for month-range picker.Is there any way I can customise and use it that way?但是我想将它用于月份范围选择器。有什么方法可以自定义并以这种方式使用它?

I've tried passing property like this [bsConfig]="{ dateInputFormat: 'YYYY-MM' }" and omitting date from it but while selecting I still need to select date.我试过传递这样的属性 [bsConfig]="{ dateInputFormat: 'YYYY-MM' }" 并从中省略日期,但在选择时我仍然需要选择日期。

<input class="form-control" name="dob" placeholder="Date of Birth" type="text"  bsDatepicker [(bsValue)]="bsValue" [bsConfig]="{ dateInputFormat: 'YYYY-MM' }">

People who are still struggling with it can set min view mode of datepicker using minMode property仍在苦苦挣扎的人可以使用 minMode 属性设置 datepicker 的最小视图模式

For the month range picker, in this case, minMode is set to 'month'.对于月份范围选择器,在这种情况下,minMode 设置为“月份”。 Refer to the official docs for working example and explanation.有关工作示例和说明,请参阅官方文档。

https://valor-software.com/ngx-bootstrap/#/datepicker#min-mode https://valor-software.com/ngx-bootstrap/#/datepicker#min-mode

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM