Back to Validation

LeapDate

docs/validators/LeapDate.md

3.1.11.3 KB
Original Source
<!-- SPDX-License-Identifier: MIT SPDX-FileCopyrightText: (c) Respect Project Contributors SPDX-FileContributor: Alexandre Gomes Gaigalas <[email protected]> SPDX-FileContributor: Henrique Moody <[email protected]> -->

LeapDate

  • LeapDate(string $format)

Validates if a date is leap.

php
v::leapDate('Y-m-d')->assert('1988-02-29');
// Validation passes successfully

This validator accepts DateTime instances as well. The $format parameter is mandatory.

Templates

LeapDate::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be a leap date
inverted{{subject}} must not be a leap date

Template placeholders

PlaceholderDescription
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Date and Time

Changelog

VersionDescription
3.0.0Templates changed
0.3.9Created

See Also