Cannot Move back to Current Date on Navigator

Asked by EJ
5 years ago.

Hi,

I seems that once our page load defaulting today's date if you click on another day you cannot select the today's date again. Today's date seems unselectable.

Comment posted by EJ
5 years ago.

My application is in Angular. Is this the same version of the control as the Angular one?

Comment posted by EJ
5 years ago.

So my component doesn't reload when switching the date back to today's date. It works on any other date.

@Component({
  selector: 'scheduler-sc-component',
  template: `
  <div class="fullscreen">
  <sidebar-container #sidebar [(expanded)]="expanded">
    <sidebar-expanded>
      <div style="padding: 3px;">
      <daypilot-navigator [config]="navigatorConfig" [date]="navigatorDate" (dateChange)="dateChange()" #navigator></daypilot-navigator>
      </div>
    </sidebar-expanded>
    <sidebar-collapsed></sidebar-collapsed>
    <sidebar-main>
      <div class="main-body">
      <app-header></app-header>
        <daypilot-scheduler [config]="config" [events]="events" (viewChange)="viewChange()" #scheduler></daypilot-scheduler>
        <app-footer></app-footer>
        <div class="main-bottom"></div>
      </div>
    </sidebar-main>
  </sidebar-container>
  </div>
`,
styles: [`
  
`]
})
  dateChange() {
    console.log('fire');
    this.config.startDate = this.navigator.control.selectionStart;
    this.config.days = new DayPilot.Duration(this.navigator.control.selectionStart, this.navigator.control.selectionEnd).totalDays() + 1;

  }

Comment posted by Dan Letecky [DayPilot]
5 years ago.

You should update the "navigatorDate" value in dateChange(). Otherwise it remains set to the default value (today). The dateChange event only fires if a change is detected.

Another option is to remove the [date] attribute.

Comment posted by Dan Letecky [DayPilot]
5 years ago.

There is indeed something wrong with the dateChange() firing, I'm checking the problem.

Answer posted by Dan Letecky [DayPilot]
5 years ago.

This issue should be fixed now in the latest sandbox build (2020.4.4804).

Comment posted by EJ
5 years ago.

Is there any plans to push an update out for the library?

This question is more than 1 month old and has been closed. Please create a new question if you have anything to add.