0
votes

I have been using this date-time picker https://dalelotts.github.io/angular-bootstrap-datetimepicker/index.html and i am changing the configuration based on other selection the user makes, but after the first change the view remains the same(the date-time picker opens on the last view that was used before) even thought the configuration was properly changed. This is a sample of my code:

<dl-date-time-picker minView="{{minView}}"
                     startView="{{startView}}"
                     maxView="year"
                     minuteStep="5"
                     #datepicker
                     [class.weekView-display]="isWeekView"
                     (change)="setDisplayDate($event)"
                     (click)="$event.stopPropagation();">
</dl-date-time-picker>

So, basically the minview and startView updates, but the user still sees the previous view.

Thank you

1
Try some debugging with ngDoCheck..Raul Martin
I did: @ViewChild('datepicker') datePicker: any; ngOnInit() { } ngDoCheck() { this.datePicker.startView = this.startView; } It seems to have my new value but the UI doesn't change its starting viewAna Munte SPB
setDisplayDate($event) is the function that should update the data ?Raul Martin
that one is triggered when you selct a date i need the selected date to calculate some things in tsAna Munte SPB

1 Answers

0
votes

I think you want to set startView.

startView is the view when the user first interacts with the date/time picker.

minView is the view when selection happens. Think if it as the last view.

From what you describe, I suspect you want to set startView, or perhaps both startView and minView to the same values.

You can see the the component does property respond to configuration changes by running the demo applocation https://github.com/dalelotts/angular-bootstrap-datetimepicker-demo

The demo is also on StackBlitz but StackBlitz has a bug at the moment - https://stackblitz.com/github/dalelotts/angular-bootstrap-datetimepicker-demo