Field::isSameValue($value1,$value2)

Version 3.8

Check if values are the same

Convert given values according to the field type and check if they are the same.

Return value

Bool TRUE if same value

Arguments

$value1
First value
$value2
Second value

Full documentation

Check if given arguments are same date:

if ( $Order->order_date->isSameValue('2014-01-08','Today') ){
    // Today is 2014-01-08
}

Check if given arguments are same duration:

if ( $Order->order_date->isSameValue('00:30','0.5') ){
    // 00:30 is same as 0.5: Half an hour.
}