How to use the @ng-bootstrap/ng-bootstrap/timepicker/ngb-time.NgbTime function in @ng-bootstrap/ng-bootstrap

To help you get started, we’ve selected a few @ng-bootstrap/ng-bootstrap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Fundator / IMO-Maritime-Single-Window / IMOMaritimeSingleWindow / Client / src / app / shared / components / date-time-picker / date-time-picker.component.ts View on Github external
persistData() {
    this.dateFormatError.emit(!this.validDateFormat);
    if (this.dateTimeModel.date && this.validDateFormat) {
      if (this.dateTimeModel.time == null) {
        this.dateTimeModel.time = new NgbTime(0, 0, 0);
      }
      this.dateTimeResult.emit(this.dateTimeModel);
    } else {
      this.dateTimeResult.emit(null);
    }
  }
github Fundator / IMO-Maritime-Single-Window / IMOMaritimeSingleWindow / Client / src / app / main-content / content-container / port-call / overview / set-actual-time / set-actual-time.component.ts View on Github external
if (this.ataModel && this.ataModel.date) {
      arrival = {
        date: new NgbDate(this.ataModel.date.year, this.ataModel.date.month, this.ataModel.date.day),
        time: new NgbTime(this.ataModel.time.hour, this.ataModel.time.minute, 0)
      };
      this.portCallModel.locationAta = new Date(arrival.date.year, arrival.date.month - 1, arrival.date.day,
        arrival.time.hour, arrival.time.minute, 0);
    } else {
      this.portCallModel.locationAta = null;
    }

    if (this.atdModel && this.atdModel.date) {
      departure = {
        date: new NgbDate(this.atdModel.date.year, this.atdModel.date.month, this.atdModel.date.day),
        time: new NgbTime(this.atdModel.time.hour, this.atdModel.time.minute, 0)
      };
      this.portCallModel.locationAtd = new Date(departure.date.year, departure.date.month - 1, departure.date.day,
        departure.time.hour, departure.time.minute, 0);
    } else {
      this.portCallModel.locationAtd = null;
    }

    this.ataAfterTodayError = arrival != null ? this.currentDate.before(arrival.date) : false;
    this.atdAfterTodayError = departure != null ? this.currentDate.before(departure.date) : false;

    if (arrival != null && departure != null) {
      this.dateSequenceError = arrival.date.after(departure.date);
      if (arrival.date.equals(departure.date)) {
        this.dateSequenceError = arrival.time.hour > departure.time.hour
          || (arrival.time.hour === departure.time.hour && arrival.time.minute >= departure.time.minute);
      }
github Fundator / IMO-Maritime-Single-Window / IMOMaritimeSingleWindow / Client / src / app / main-content / content-container / port-call / registration / forms / prev-and-next-poc / prev-and-next-poc.component.ts View on Github external
data => {
        if (data) {
          const dateTime = new Date(data);
          this.prevEtdModel = {
            date: new NgbDate(dateTime.getFullYear(), dateTime.getMonth() + 1, dateTime.getDate()),
            time: new NgbTime(dateTime.getHours(), dateTime.getMinutes(), 0)
          };
        } else {
          this.prevEtdModel = {
            date: null,
            time: new NgbTime(0, 0, 0)
          };
        }
        this.validateDateTime();
      }
    );
github Fundator / IMO-Maritime-Single-Window / IMOMaritimeSingleWindow / Client / src / app / main-content / content-container / port-call / registration / forms / security / last-10-port-calls / last-10-port-calls.component.ts View on Github external
private resetModel() {
    this.locationFound = false;
    this.arrivalModel = {
      date: null,
      time: new NgbTime(0, 0, 0)
    };
    this.departureModel = {
      date: null,
      time: new NgbTime(0, 0, 0)
    };
    this.formModel = new SecurityPreviousPortOfCallModel();
  }
github Fundator / IMO-Maritime-Single-Window / IMOMaritimeSingleWindow / Client / src / app / main-content / content-container / port-call / registration / forms / prev-and-next-poc / prev-and-next-poc.component.ts View on Github external
const etdDateTime: Date = new Date(this.prevEtdModel.date.year, this.prevEtdModel.date.month - 1, this.prevEtdModel.date.day, this.prevEtdModel.time.hour, this.prevEtdModel.time.minute);
        this.prevAndNextPocService.setPrevPortOfCallEtd(etdDateTime);
      } else {
        const etdDateTime: DateTime = {
          date: null,
          time: new NgbTime(0, 0, 0)
        };
        this.prevAndNextPocService.setPrevPortOfCallEtd(null);
      }
      if (this.nextEtaModel.date) {
        const etaDateTime: Date = new Date(this.nextEtaModel.date.year, this.nextEtaModel.date.month - 1, this.nextEtaModel.date.day, this.nextEtaModel.time.hour, this.nextEtaModel.time.minute);
        this.prevAndNextPocService.setNextPortOfCallEta(etaDateTime);
      } else {
        const etaDateTime: DateTime = {
          date: null,
          time: new NgbTime(0, 0, 0)
        };
        this.prevAndNextPocService.setNextPortOfCallEta(null);
      }
    }
  }
}
github Fundator / IMO-Maritime-Single-Window / IMOMaritimeSingleWindow / Client / src / app / main-content / content-container / port-call / registration / forms / prev-and-next-poc / prev-and-next-poc.component.ts View on Github external
data => {
        if (data) {
          const dateTime = new Date(data);
          this.prevEtdModel = {
            date: new NgbDate(dateTime.getFullYear(), dateTime.getMonth() + 1, dateTime.getDate()),
            time: new NgbTime(dateTime.getHours(), dateTime.getMinutes(), 0)
          };
        } else {
          this.prevEtdModel = {
            date: null,
            time: new NgbTime(0, 0, 0)
          };
        }
        this.validateDateTime();
      }
    );
github Fundator / IMO-Maritime-Single-Window / IMOMaritimeSingleWindow / Client / src / app / shared / services / validate-date-time.service.ts View on Github external
getNgbDateTimeFormat(dateTime) {
    const newDate = new NgbDate(dateTime.date.getFullYear(), dateTime.date.getMonth() + 1, dateTime.date.getDate());
    const newTime = new NgbTime(dateTime.time);
    const newDateTime = {date: newDate, time: newTime};
    return newDateTime;
  }
github Fundator / IMO-Maritime-Single-Window / IMOMaritimeSingleWindow / Client / src / app / main-content / content-container / port-call / registration / forms / prev-and-next-poc / prev-and-next-poc.component.ts View on Github external
etaEtdData => {
        if (etaEtdData) {
          this.currentEtaModel = {
            date: new NgbDate(etaEtdData.eta.year, etaEtdData.eta.month, etaEtdData.eta.day),
            time: new NgbTime(etaEtdData.eta.hour, etaEtdData.eta.minute, 0)
          };
          this.currentEtdModel = {
            date: new NgbDate(etaEtdData.etd.year, etaEtdData.etd.month, etaEtdData.etd.day),
            time: new NgbTime(etaEtdData.etd.hour, etaEtdData.etd.minute, 0)
          };
        }
        this.validateDateTime();
      }
    );