I am creating a form and I need to set the “from” date to the “to” date. I have managed to get the dates and convert them to strings $result and $lastDateOfMonth. But the two text fields remain blank. What am I doing wrong?
<?php
$data = $this->dataStore('employees')->data();
$dateString = $data[0]['taxyear']; //need to append 01 to end of TY
$dateString=$dateString."01";
$lastDateOfMonth = date("Y-m-t", strtotime($dateString));
$date=date_create($lastDateOfMonth);
date_modify($date,"-364 days");
$result = $date->format('Y-m-d');
?>
<label for="from">from:</label><input name="from" value=<?php $result?> >
<label for="to">to:</label><input name="to" value=<?php $lastDateOfMonth?> >