File

core/time-interval/time-interval.component.ts

Implements

AfterViewInit

Metadata

Index

Properties
Methods
Inputs
Outputs

Inputs

dateRangePickerConfig
Type : DateRangePickerConfig
maxCustomDate
Type : Date
minCustomDate
Type : Date
selectedInterval
Type : TimeIntervalOption
Default value : LAST_HOUR

Outputs

interval
Type : EventEmitter<TimeInterval>

Methods

changeCustomRange
changeCustomRange(range: Date[])
Parameters :
Name Type Optional
range Date[] No
Returns : void
changeInterval
changeInterval(intervalOption: TimeIntervalOption)
Parameters :
Name Type Optional
intervalOption TimeIntervalOption No
Returns : void
ngAfterViewInit
ngAfterViewInit()
Returns : void
reload
reload()
Returns : void

Properties

CUSTOM
Default value : CUSTOM
customRange
Type : Date[]
intvervals
Default value : INTERVAL_OPTIONS
<form class="form-inline">
  <div class="form-group">
    <div class="c8y-select-wrapper">
      <select
        class="form-control"
        [attr.aria-label]="'Time interval' | translate"
        name="interval"
        [(ngModel)]="selectedInterval"
        (ngModelChange)="changeInterval($event)"
      >
        <option
          *ngFor="let interval of intvervals"
          [ngValue]="interval"
        >
          {{ interval.label | translate }}
        </option>
      </select>
    </div>
  </div>

  <div
    class="form-group datepicker"
    *ngIf="selectedInterval === CUSTOM"
  >
    <input
      class="form-control"
      [placeholder]="'Select date range' | translate"
      bsDaterangepicker
      [bsConfig]="dateRangePickerConfig"
      [minDate]="minCustomDate"
      [maxDate]="maxCustomDate"
      [(bsValue)]="customRange"
      (bsValueChange)="changeCustomRange($event)"
    />
  </div>

  <button
    class="btn btn-link"
    [title]="'Reload' | translate"
    type="button"
    [disabled]="selectedInterval === CUSTOM && (!customRange || customRange.length === 0)"
    (click)="reload()"
  >
    <i c8yIcon="refresh"></i>
    {{ 'Reload' | translate }}
  </button>
</form>

results matching ""

    No results matching ""