<?php
namespace nur\data\types;

use nur\b\date\Hour;

class SHourType extends STimeType {
  const TITLE = "heure du jour";

  private static $instance;
  static final function to_hour($value) {
    $type = self::$instance;
    if ($type === null) self::$instance = $type = new self();
    return $type->with($value);
  }

  function verifixConvert(&$value): bool {
    if ($value === null) return true;
    $value = (new Hour($value))->format();
    return true;
  }
}
