Commit e205b070 authored by Fernando Takagi's avatar Fernando Takagi
Browse files

Double bind haystack variable to component

parent 9d2ff6f3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
      </div>
    </div>
    <div class="col-md-4">
      <input type="datetime-local" id="haystack" class="form-control" [(ngModel)]="haystack">
      <input type="datetime-local" id="haystack" class="form-control" [ngModel]="haystack | date:'yyyy-MM-ddTHH:mm'" (ngModelChange)="setHaystack($event)" value="">
    </div>
  </div>
  <div class="col-md-3"></div>
+8 −1
Original line number Diff line number Diff line
@@ -80,7 +80,10 @@ export class ChatListComponent implements OnInit {

    this.nextCursor = qp.get('cursor');
    this.forward = qp.get('forward') === 'true';
    this.haystack = new Date(Number(qp.get('haystack')));
    const haystack = qp.get('haystack');
    if (haystack !== null) {
      this.haystack = new Date(Number(haystack) * 1000);
    }
    let qType = qp.get("type");
    this.type = Number(qType)

@@ -225,6 +228,10 @@ export class ChatListComponent implements OnInit {
    return this.confirmDeleteForm.controls;
  }

  public setHaystack(e: string) {
    this.haystack = new Date(e);
  }

  public openDeleteDataModal(modal): void {
    this.modalService.open(modal, {centered: true}).result.then(() => {
      this.deleteData();