Kernel::System::DataValidation::Validator::DateTimeLower

NAME

Kernel::System::DataValidation::Validator::DateTimeLower – Validator that verifies given date time strings are greater than 'x'.

PUBLIC INTERFACE

Provides a Check method, that will be called by the Kernel::System::DataValidation backend.

Example()

Returns an example of a possible value to be verified.

Check()

Checks if the given value can be transformed to a datetime object. For more information, please refer to Kernel::System::DateTime.

    my $True = $Validator->Check(
        Value => '2018-04-25 14:26:15',
        Arguments => {
            Than => '2018-05-25 00:12:12',
        },
    );

    my $True = $Validator->Check(
        Value => '2018-04-25 14:26:15',
        Arguments => {
            EqualThan => '2018-04-25 14:26:15',
            DateOnly  => 1,  # (optional) ignore the time component, compare the dates only
        },
    );

    my $False = $Validator->Check(
        Value => '2019-09-09',
        Arguments => {
            Than => '2017-01-01 00:00:00',
        },
    );
Scroll to Top