My mom came to live in an assisted living facility near where I live four months before she died. She had dementia and she could say some real off the wall things. However, I came to a point where I really looked forward to visiting her. For me, it was the closest I'll ever get to going through a time machine.
When I entered her room, the past became alive. When I was with her, my grandparents were still alive living in the house she grew up in. A house I was very familiar with since it was a large part of my childhood. She could remember things from the past, and remember people, but time was not linear. At the same time my grandparents were alive and taking care of her younger sister (my aunt) her cousin, who was more like a brother to her, was graduating from medical school, was married living in New York, and had kids, all events that happened years apart. However, it was almost magical to me, she would tell me she was waiting on my grandfather to come visit, and I would tell her he was there yesterday, but she was asleep and didn't want to bother her, and she would accept that, and it would calm her down.
We could talk about things that happened before I was born as if it happened yesterday. At times she would be confused as to where she was, and I would tell her to look out the window and say that she was back in her home town where she grew up, she would be overjoyed. She would tell me she thought she would never see it again. I just referred to it as living in her world, and we would have wonderful visits.
Also, it ended up giving me a little peace upon her passing. The last time I saw her, when she was still cognizant, we visited, I played some music for her (Glen Miller Moonlight Serenade) which she loved, and then I got ready to leave. I told her, as I always did when I was leaving, that I had to go, but would be back later to visit. In the meantime, her dad was supposed to come by later. She would always say, "That's wonderful, I'm so glad he's coming" and she would be in a good mood. Her short term memory was gone, so she would forget it in five minutes, but it gave her some peace and comfort for the moment.
When I left that last time and told her he father would be by in a bit, she looked at me and said, "He's not coming later, he's here now!" I asked her, "you mean grandpa is here in the room right now?" And she looked at me and pointed at the end of her bed and said "He's standing right there!"
That's the last thing she ever said to me, when I went to visit her the next night, she was not conscious, and she never came out of it, she died four days later. I believe my grandfather was there, and he was ready to walk with her as she passed.
You can't fight it, you can't change it, so try to see if there is anything positive you can take from it. May peace be with you