when it's not finished, no matter whether you use it in the past, in the present or in the future , which i often when happen to have a problem with. but one thing is for sure that there's no way you can use yesterday with perfect time. but you can use it when talking about today, as the action is not finished yet.
'yesterday' is finished time, so use the past. 'today' is different- we use both.
i could say 'i haven't had lunch today', unfinished time and i expect to have lunch. if i have left my office and am on the bus home i could say 'i did a 