简体   繁体   English

Angular Daterangepicker更改区域设置

[英]Angular Daterangepicker Change Locale

My question is about the widget from daterangepicker.com. 我的问题是关于daterangepicker.com中的小部件的。 The problem I am facing is that when I try to change the locale by changing options $scope.opts = {...} the ng-model $scope.date = {...} binds before this happens and always uses the previous locale. 我面临的问题是,当我尝试通过更改选项 $ scope.opts = {...}来更改语言环境时, ng-model $ scope.date = {...}会在此之前绑定,并且始终使用以前语言环境。

<input date-range-picker id="datepick"
    autoUpdateInput="true"
    name="datepick"
    class="form-control date-picker"
    type="text"
    options="opts"
    ng-model="date"
required/>

component.html component.html

>   <div class="row">
>     <div class="input-field col s12">
>       <input formControlName="birthDate" id="birthDate" type="date" class="datepicker" materialize="pickadate" [materializeParams]="[{
> format: 'yyyy-mm-dd', formatSubmit: 'yyyy-mm-dd',
>         closeOnSelect: true, selectMonths: true, selectYears: true, today: '',
>         max: true, onSet: onSetDatepicker }]">
>       <label for="birthDate">Birthday*</label>
>     </div>   </div>

component.ts component.ts

>  onSetDatepicker(date) {
>     if (date.select) {
>       $('#birthDate').pickadate().pickadate('picker').close();
>     }   }

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

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