How to use the @instructure/ui-utils/lib/i18n/DateTime.parse function in @instructure/ui-utils

To help you get started, we’ve selected a few @instructure/ui-utils 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 instructure / instructure-ui / packages / ui-core / src / components / TimeInput / index.js View on Github external
getSelectedOption (format, locale, timezone, value) {
    if (!value) {
      return
    }

    return {
      value: value,
      label: DateTime.parse(value, locale, timezone).format(format)
    }
  }
github instructure / instructure-ui / packages / ui-core / src / components / DatePicker / index.js View on Github external
_parseDate (dateStr, locale, timezone) {
    return DateTime.parse(dateStr, locale, timezone)
  }
github instructure / instructure-ui / packages / ui-core / src / components / TimeInput / index.js View on Github external
getBaseDateForRendering (defaultValue, locale, timezone, value) {
    let baseDate
    const baseValue = value || defaultValue
    if (baseValue) {
      baseDate = DateTime.parse(baseValue, locale, timezone)
    } else {
      baseDate = DateTime.now(locale, timezone)
    }
    return baseDate.second(0).millisecond(0)
  }
github instructure / instructure-ui / packages / ui-core / src / components / DateInput / index.js View on Github external
_parseDate (dateStr, locale, timezone) {
    return DateTime.parse(dateStr, locale, timezone)
  }