Files
grzanieplus.pl/plugins/stDeliveryPlugin/lib/stTimeValidator.class.php
2025-03-12 17:06:23 +01:00

16 lines
389 B
PHP

<?php
class stTimeValidator extends sfValidator
{
public function execute(&$value, &$error)
{
if (!preg_match('/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/', $value))
{
$error = $this->context->getI18N()->__('Musisz przekazać poprawną godzinę (np. 11:00)', null, 'stDeliveryBackend');
return false;
}
return true;
}
}