function testValidDateTimeComponentValue(component, value) {
    if (getDateTimeComponentValues(component).indexOf(value) === -1) {
        $ERROR("Invalid value " + value + " for date-time component " + component + ".");
    }
    return true;
}
Tests that the given value is valid for the given date-time component.
@param {string} component a date-time component.
@param {string} value the value to be tested.
@return {boolean} true if the test succeeds.
@exception if the test fails.