ARCH: How to know what you upgraded

I wrote a little bash function to do that (nothing complicated), here's the code

function whatdidiupgrade(){
    if [[ $1 == "today" ]];
    then
        grep $(date +%Y-%m-%d) /var/log/pacman.log | grep upgraded;
    elif [[ $1 == "yesterday" ]];
    then
        grep $(date --date="1 days ago" +%Y-%m-%d) /var/log/pacman.log | grep upgraded;
    else
        grep upgraded /var/log/pacman.log;
    fi
}