elements specifying a datetime attribute must use valid machine-readable ISO-8601 date, time, or duration syntax.'; } public function getStandard(): WCAGStandard { return WCAGStandard::A; } public function getSeverity(): Severity { return Severity::WARNING; } public function getLevel(): int { return 4; } public function check(DOMElement $element): ?Violation { if (strtolower($element->tagName) !== 'time' || !$element->hasAttribute('datetime')) { return null; } $dt = trim($element->getAttribute('datetime')); if ($dt === '' || preg_match('/\{\{|\{%|<\?php/', $dt)) { return null; } // Valid HTML5