isTime static method

bool isTime(
  1. String value
)

Implementation

static bool isTime(String value) {
  if (value == _zeroSeconds || value == _zeroMilliseconds) return true;
  final String lower = value.toLowerCase();
  String unit;
  if (lower.endsWith(MILLISECONDS)) {
    unit = MILLISECONDS;
  } else if (lower.endsWith(SECOND)) {
    unit = SECOND;
  } else {
    return false;
  }
  final String numberPart = value.substring(0, value.length - unit.length);
  return CSSNumber.isNumber(numberPart);
}