Processes this time zone entry widget

If any validation type errors occur, an error message is attached to
this entry widget.
4503
public function process()
    {
        parent::process();

        $areas_flydown = $this->getCompositeWidget('areas_flydown');
        $regions_flydown = $this->getCompositeWidget('regions_flydown');

        if ($areas_flydown->value === 'UTC') {
            $this->value = 'UTC';
        } elseif (
            $areas_flydown->value === null ||
            $regions_flydown->value === null
        ) {
            $this->value = null;
        } else {
            $this->value =
                $areas_flydown->value . '/' . $regions_flydown->value;
        }

        if (!$this->required && $this->value === null && $this->isSensitive()) {
            return;
        } elseif ($this->value === null) {
            $message = Swat::_('The %s field is required.');
            $this->addMessage(new SwatMessage($message, 'error'));
        } else {
            try {
                $time_zone = new DateTimeZone($this->value);
            } catch (Exception $e) {
                $message = Swat::_('The %s field is an invalid time zone.');
                $this->addMessage(new SwatMessage($message, 'error'));
            }
        }
    }
901296
@Override protected void processCalendarExceptions(byte[] data, ProjectCalendar cal)
   {
      //
      // Handle any exceptions
      //
      int exceptionCount = MPPUtility.getShort(data, 0);

      if (exceptionCount != 0)
      {
         int index;
         int offset;
         ProjectCalendarException exception;
         long duration;
         int periodCount;
         Date start;

         for (index = 0; index < exceptionCount; index++)
         {
            offset = 4 + (60 * 7) + (index * 64);

            Date fromDate = MPPUtility.getDate(data, offset);
            Date toDate = MPPUtility.getDate(data, offset + 2);
            exception = cal.addCalendarException(fromDate, toDate);

            periodCount = MPPUtility.getShort(data, offset + 6);
            if (periodCount != 0)
            {
               for (int exceptionPeriodIndex = 0; exceptionPeriodIndex < periodCount; exceptionPeriodIndex++)
               {
                  start = MPPUtility.getTime(data, offset + 12 + (exceptionPeriodIndex * 2));
                  duration = MPPUtility.getDuration(data, offset + 24 + (exceptionPeriodIndex * 4));
                  exception.addRange(new DateRange(start, new Date(start.getTime() + duration)));
               }
            }
         }
      }
   }
1370615
private void createMaintenanceTimeZoneControl() {
        // ComboBoxBuilder cannot be used here, because Builder do
        // 'comboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);'
        // which interferes our code: 'timeZone.addItems(getAllTimeZones());'
        timeZone = new ComboBox();
        timeZone.setId(UIComponentIdProvider.MAINTENANCE_WINDOW_TIME_ZONE_ID);
        timeZone.setCaption(i18n.getMessage("caption.maintenancewindow.timezone"));
        timeZone.addItems(getAllTimeZones());
        timeZone.setValue(getClientTimeZone());
        timeZone.addStyleName(ValoTheme.COMBOBOX_SMALL);
        timeZone.setTextInputAllowed(false);
        timeZone.setNullSelectionAllowed(false);
    }
565912
def validate(self, raw_data, **kwargs):
        """"""

        super(DateTimeField, self).validate(raw_data, **kwargs)
        try:
            if isinstance(raw_data, datetime.datetime):
                self.converted = raw_data
            elif self.serial_format is None:
                # parse as iso8601
                self.converted = parse(raw_data)
            else:
                self.converted = datetime.datetime.strptime(raw_data,
                                                            self.serial_format)
            return raw_data
        except (ParseError, ValueError) as e:
            msg = self.messages['parse'] % dict(cls=self.__class__.__name__,
                                                data=raw_data,
                                                format=self.serial_format)
            raise ValidationException(msg, raw_data)
120371
void validateIatAndExp(JwtClaims jwtClaims, long clockSkewInMilliseconds) throws InvalidClaimException {
		if (jwtClaims == null) {
			if (tc.isDebugEnabled()) {
				Tr.debug(tc, "Missing JwtClaims object");
			}
			return;
		}
		NumericDate issueAtClaim = getIssuedAtClaim(jwtClaims);
		NumericDate expirationClaim = getExpirationClaim(jwtClaims);

		debugCurrentTimes(clockSkewInMilliseconds, issueAtClaim, expirationClaim);

		validateIssuedAtClaim(issueAtClaim, expirationClaim, clockSkewInMilliseconds);
		validateExpirationClaim(expirationClaim, clockSkewInMilliseconds);

	}
601624
def validate(self, value, model_instance):
        
        # pylint: disable=newstyle
        super(TimeZoneField, self).validate(
            value=self.get_prep_value(value),
            model_instance=model_instance
        )

        # Insure the value is can be converted to a timezone
        self.to_python(value)
68304
private String validateDuration() {

        if (!isValidEndTypeForPattern()) {
            return Messages.ERR_SERIALDATE_INVALID_END_TYPE_FOR_PATTERN_0;
        }
        switch (getEndType()) {
            case DATE:
                return (getStart().getTime() < (getSeriesEndDate().getTime() + DAY_IN_MILLIS))
                ? null
                : Messages.ERR_SERIALDATE_SERIES_END_BEFORE_START_0;
            case TIMES:
                return getOccurrences() > 0 ? null : Messages.ERR_SERIALDATE_INVALID_OCCURRENCES_0;
            default:
                return null;
        }

    }
1250051
@Override
    public void validate(final FacesContext context) {
        // iterate over submitted values and attempt to convert to the proper
        // data type. For successful values, remove from submitted and add to
        // local values map. for failures, add a conversion message and leave in
        // the submitted state
        final Iterator<Entry<SheetRowColIndex, String>> entries = submittedValues.entrySet().iterator();
        final boolean hadBadUpdates = !getInvalidUpdates().isEmpty();
        getInvalidUpdates().clear();
        while (entries.hasNext()) {
            final Entry<SheetRowColIndex, String> entry = entries.next();
            final SheetColumn column = getColumns().get(entry.getKey().getColIndex());
            final String newValue = entry.getValue();
            final String rowKey = entry.getKey().getRowKey();
            final int col = entry.getKey().getColIndex();
            setRowVar(context, rowKey);

            // attempt to convert new value from string to correct object type
            // based on column converter. Use PF util as helper
            final Converter converter = ComponentUtils.getConverter(context, column);

            // assume string value if converter not found
            Object newValueObj = newValue;
            if (converter != null) {
                try {
                    newValueObj = converter.getAsObject(context, this, newValue);
                }
                catch (final ConverterException e) {
                    // add offending cell to list of bad updates
                    // and to a StringBuilder for error messages (so we have one
                    // message for the component)
                    setValid(false);
                    FacesMessage message = e.getFacesMessage();
                    if (message == null) {
                        message = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), e.getMessage());
                    }
                    context.addMessage(this.getClientId(context), message);

                    final String messageText = message.getDetail();
                    getInvalidUpdates()
                                .add(new SheetInvalidUpdate(getRowKeyValue(context), col, column, newValue, messageText));
                    continue;
                }
            }
            // value is fine, no further validations (again, not to be confused
            // with validators. until we have a "required" or something like
            // that, nothing else to do).
            setLocalValue(rowKey, col, newValueObj);

            // process validators on column
            column.setValue(newValueObj);
            try {
                column.validate(context);
            }
            finally {
                column.resetValue();
            }

            entries.remove();
        }
        setRowVar(context, null);

        final boolean newBadUpdates = !getInvalidUpdates().isEmpty();
        final String errorMessage = getErrorMessage();

        if (hadBadUpdates || newBadUpdates) {
            // update the bad data var if partial request
            if (context.getPartialViewContext().isPartialRequest()) {
                renderBadUpdateScript(context);
            }
        }

        if (newBadUpdates && errorMessage != null) {
            final FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, errorMessage, errorMessage);
            context.addMessage(null, message);
        }
    }
346595
private void tryRegisterTimeZone() {
        try {
            registered.put(SimpleTimeZone.class, JDKStringConverter.TIME_ZONE);

        } catch (Throwable ex) {
            if (LOG) {
                System.err.println("tryRegisterTimeZone1: " + ex);
            }
        }
        try {
            TimeZone zone = TimeZone.getDefault();
            registered.put(zone.getClass(), JDKStringConverter.TIME_ZONE);

        } catch (Throwable ex) {
            if (LOG) {
                System.err.println("tryRegisterTimeZone2: " + ex);
            }
        }
        try {
            TimeZone zone = TimeZone.getTimeZone("Europe/London");
            registered.put(zone.getClass(), JDKStringConverter.TIME_ZONE);

        } catch (Throwable ex) {
            if (LOG) {
                System.err.println("tryRegisterTimeZone3: " + ex);
            }
        }
    }
203114
private static boolean isValidID(String value) {
    try {
      ZoneId.of(value);
    } catch (DateTimeException e) { // ZoneRulesException is subclass of DateTimeException
      return false;
    }
    return true;
  }
580784
def _validate_datetime_from_to(cls, start, end):
        
        if not start <= end:
            raise MlbAmBadParameter("not Start Day({start}) <= End Day({end})".format(start=start, end=end))
734938
def _ValidateClosedTimeRange(time_range):
  """"""
  time_range_start, time_range_end = time_range
  _ValidateTimestamp(time_range_start)
  _ValidateTimestamp(time_range_end)
  if time_range_start > time_range_end:
    raise ValueError("Invalid time-range: %d > %d." %
                     (time_range_start.AsMicrosecondsSinceEpoch(),
                      time_range_end.AsMicrosecondsSinceEpoch()))
349721
public void validate() {
    if (metric == null || metric.isEmpty()) {
      throw new IllegalArgumentException("missing or empty metric");
    }

    if (id == null || id.isEmpty()) {
      throw new IllegalArgumentException("missing or empty id");
    }
    Query.validateId(id);

    if (time_offset != null) {
      DateTime.parseDateTimeString(time_offset, null);
    }
    
    if (aggregator != null && !aggregator.isEmpty()) {
      try {
        Aggregators.get(aggregator.toLowerCase());
      } catch (final NoSuchElementException e) {
        throw new IllegalArgumentException("Invalid aggregator");
      }
    }

    if (fill_policy != null) {
      fill_policy.validate();
    }
  }
731477
public function validateDateTime($value, $errorMessage, $errorField = null)
    {
        if (!strtotime($value)) {
            $this->error($errorMessage);
            $this->_errorFields[] = $errorField;
        }
    }
1203709
def __validate_datetime_string(self):
        

        try:
            try:
                StrictVersion(self._value)
                raise TypeConversionError(
                    "invalid datetime string: version string found {}".format(self._value)
                )
            except ValueError:
                pass
        except TypeError:
            raise TypeConversionError("invalid datetime string: type={}".format(type(self._value)))
1036658
def validate_a_time_filter(self, value):
        
        if value:
            try:
                utils.parse_datetime_range(value)
            except Exception as e:
                raise serializers.ValidationError(e.message)

        return value
915358
protected void onReceiveValidationResults(Map<String, CmsValidationResult> results) {

        try {
            for (Map.Entry<String, CmsValidationResult> resultEntry : results.entrySet()) {
                String fieldName = resultEntry.getKey();
                CmsValidationResult result = resultEntry.getValue();
                provideValidationResult(fieldName, result);
            }
            m_handler.onValidationFinished(m_validationOk);
        } finally {
            CmsValidationScheduler.get().executeNext();
        }
    }