public function getFormattedDate(int $dateType, $date): string
  {
    if ($date=='') return '';

    switch ($dateType)
    {
      case self::FORMAT_FULL:
        $format = $this->language['lan_date_format_full'];
        break;

      case self::FORMAT_LONG:
        $format = $this->language['lan_date_format_long'];
        break;

      case self::FORMAT_MEDIUM:
        $format = $this->language['lan_date_format_medium'];
        break;

      case self::FORMAT_SHORT:
        $format = $this->language['lan_date_format_short'];
        break;

      default:
        throw new FallenException('dateType', $dateType);
    }

    $oldLocale = setlocale(LC_TIME, 0);
    $locale    = setlocale(LC_TIME, $this->language['lan_locale']);
    if ($locale===false) throw new RuntimeException('Unable to set locate to %s', $this->language['lan_locale']);

    switch (true)
    {
      case is_string($date):
        $formatted = strftime($format, strtotime($date));
        break;

      case is_int($date):
        $formatted = strftime($format, strtotime((string)$date));
        break;

      case is_a($date, '\DateTimeInterface'):
        $formatted = strftime($format, $date->getTimestamp());
        break;

      default:
        throw new FallenException('type', gettype($date));
    }

    setlocale(LC_TIME, $oldLocale);

    return $formatted;
  }