Your approach seems very strange to me but in any case, you are missing dollar-signs, so like this:
<eval token="earliestTime">if(isstr(earliest), relative_time(now(),earliest), earliest)</eval>
<eval token="latestTime">if(isstr(latest), relative_time(now(),latest), latest)</eval>
<eval token="earliestTime1">relative_time($earliestTime$,"-7d")</eval>
<eval token="latestTime1">relative_time($latestTime$,"-7d")</eval>
<eval token="earliestTime2">relative_time($earliestTime$,"-14d")</eval>
<eval token="latestTime2">relative_time($latestTime$,"-14d")</eval>
<eval token="earliestTime3">relative_time($earliestTime$,"-21d")</eval>
<eval token="latestTime3">relative_time($latestTime$,"-21d")</eval>
<eval token="earliestTime4">relative_time($earliestTime$,"-28d")</eval>
<eval token="latestTime4">relative_time($latestTime$,"-28d")</eval>
... View more