0

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

4
  • Try some debugging with ngDoCheck.. Commented Nov 1, 2018 at 12:29
  • 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 view Commented Nov 2, 2018 at 9:38
  • setDisplayDate($event) is the function that should update the data ? Commented Nov 2, 2018 at 13:43
  • that one is triggered when you selct a date i need the selected date to calculate some things in ts Commented Nov 2, 2018 at 14:43

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.