Automattic\WooCommerce\Blocks\Domain\Services\CheckoutFieldTypes
DateFieldType::is_absolute_date
Returns true if the given value is a date in YYYY-MM-DD format.
Method of the class: DateFieldType{}
No Hooks.
Returns
bool.
Usage
// private - for code of main (parent) class only $result = $this->is_absolute_date( $value ): bool;
- $value(mixed) (required)
- The value to check.
DateFieldType::is_absolute_date() DateFieldType::is absolute date code WC 11.3.0
private function is_absolute_date( $value ): bool {
return is_string( $value ) && 1 === preg_match( '/^' . self::DATE_PATTERN . '$/', $value );
}