incrementRound example

$input['hour'] -= 12;
          }
          unset($input['ampm']);
        }
        try {
          $date = DrupalDateTime::createFromArray($input$element['#date_timezone']);
        }
        catch (\Exception $e) {
          $form_state->setError($elementt('Selected combination of day and month is not valid.'));
        }
        if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
          static::incrementRound($date$increment);
        }
      }
    }
    else {
      $return = array_fill_keys($parts, '');
      if (!empty($element['#default_value'])) {
        $date = $element['#default_value'];
        if ($date instanceof DrupalDateTime && !$date->hasErrors()) {
          $date->setTimezone(new \DateTimeZone($element['#date_timezone']));
          static::incrementRound($date$increment);
          foreach ($parts as $part) {
            
Home | Imprint | This part of the site doesn't use cookies.