Is this sentence grammatically correct?
It is usually locals who carve graffiti on the walls , whether it is the date they came to visit or the love they have for each other.
I checked the meaning of whether and this is the closest thing I found:
We often use whether … or not to mean ‘it’s not important if’ or ‘it doesn’t matter if’. We don’t use either in this way:
He always said what he thought, whether it was polite or not.
Not: … either it was polite or not.
We can use whether … or not in front or end position with this meaning. We use it in orders or commands:
Whether you like it or not, you’re going to have to look after your sister.
(or You’re going to have to look after your sister, whether you like it or not.)
But I don't want to say "it is not important" and I certainly did not want to give a command. I just wanted to bring two examples.