<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Utils\WssField\Allgemein;

class WssFieldAllgemeinDateTime extends \Kufer\KuferTools\Utils\WssField\WssField
{
  protected function getValue($datamodulWert, $isFormular = false)
  {
    $validDateTime = \DateTimeOperations::getValidDateTimeString(parent::getValue($datamodulWert, $isFormular));
    if (\DateTimeOperations::isDateTimeEmptyOrDefault($validDateTime)) {
      return '';
    }

    return $validDateTime;
  }

  protected function isMandatoryValueEmpty($value)
  {
    return \DateTimeOperations::isDateTimeEmptyOrDefault($value);
  }
}