Description
Calling modify() on a ChronosDate instance with relative expressions such as 'second monday of this month' throws an error.
Steps to Reproduce
use Cake\Chronos\ChronosDate;
$date = (new ChronosDate('2026-09-01'))->modify('second monday of this month');
Expected Behavior
The ChronosDate instance is modified to the second Monday of the month.
Actual Behavior
Throws an exception:
Cannot modify date objects by time values
Environment
- cakephp/chronos: 3.5.1
- PHP: 8.5
Description
Calling
modify()on aChronosDateinstance with relative expressions such as'second monday of this month'throws an error.Steps to Reproduce
Expected Behavior
The
ChronosDateinstance is modified to the second Monday of the month.Actual Behavior
Throws an exception:
Environment