I loved talking to him, but over the last year, he hasn't been very pleasant to talk to.
I loved talking to him, but in the last year, he hasn't been very pleasant to talk to.
Are both sentences grammatically correct? Is there any difference between these sentences in terms of their meaning? I would probably use the first sentence myself, but I can't tell why.