How to use terra-time-input - 5 common examples

To help you get started, we’ve selected a few terra-time-input 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 cerner / terra-framework / packages / terra-date-time-picker / src / DateTimeUtils.js View on Github external
}

  /**
   * Converts a date/time string in the given format to a moment object.
   * @param {string} date - The date string for the conversion.
   * @param {string} time - The time string for the conversion.
   * @param {string} dateformat - The format of the date and time strings.
   * @param {boolean} hasSeconds - If true seconds will be converted
   * @return {object} - The moment object representing the given date and time.
   */
  static convertDateTimeStringToMomentObject(date, time, dateformat, hasSeconds) {
    return DateTimeUtils.updateTime(DateUtil.createSafeDate(DateUtil.convertToISO8601(date, dateformat)), time, hasSeconds);
  }
}

DateTimeUtils.FORMAT_12_HOUR = TimeUtil.FORMAT_12_HOUR;
DateTimeUtils.FORMAT_24_HOUR = TimeUtil.FORMAT_24_HOUR;

export default DateTimeUtils;
github cerner / terra-framework / packages / terra-date-time-picker / src / DateTimeUtils.js View on Github external
/**
   * Converts a date/time string in the given format to a moment object.
   * @param {string} date - The date string for the conversion.
   * @param {string} time - The time string for the conversion.
   * @param {string} dateformat - The format of the date and time strings.
   * @param {boolean} hasSeconds - If true seconds will be converted
   * @return {object} - The moment object representing the given date and time.
   */
  static convertDateTimeStringToMomentObject(date, time, dateformat, hasSeconds) {
    return DateTimeUtils.updateTime(DateUtil.createSafeDate(DateUtil.convertToISO8601(date, dateformat)), time, hasSeconds);
  }
}

DateTimeUtils.FORMAT_12_HOUR = TimeUtil.FORMAT_12_HOUR;
DateTimeUtils.FORMAT_24_HOUR = TimeUtil.FORMAT_24_HOUR;

export default DateTimeUtils;

terra-time-input

A controlled input component for entering time.

Apache-2.0
Latest version published 7 months ago

Package Health Score

54 / 100
Full package analysis