Not meaning to offend, but your comments re the punctuation are in error, as are the comments of several other responders. To start, there are five errors found in the inscription:
1st and 2nd errors -- Wherever a comma is used as a separator, it demands a following space. In both cases, where the comma occurs, its following space is absent.
3rd error -- There should be no comma between the words "President" and "Donald". In journalism or advertising, one would not write "Colonel,Richard Smith" or "Mayor,John Jones". Here, one does not write "President,Donald J. Trump. The comma sould not be present.
4th error -- On the other hand, one would not write "ColonelRichard Smith". Proper writing of a title preceding the name would insert a space between the title and the name, as in "Colonel Richard Smith" or "President Donald J. Trump". The space should be inserted.
5th error -- to a European mathemetician "20,2017" would represent what to an English-speaking means "20.2017" in the decimal system. The absence of the space is confusing. *****
Regarding the errors of other commenters:
o When the title refers to the Chief Magistrate of the United States, the word "President" is always, always capitalized, whether it is associated with a name or another title (i. e., "Mr. President"), or whenever it stands alone in a sentence. o The hat's inscription better and more elegantly phrased would be the line (which does use correct punctuation):
Donald J. Trump, President
o Making a pronouncement without checking the style book or giving an authoritative grammar reference is a faux pas, and could be offensive.
In the above cases, see the Grammar section of the "Webster's Third New International Dictionary (Unabridged)."

Your post reminds me of my mom. She once received a letter from some company that wanted to represent my parent’s small business. It was a full-page letter. I can still recall her going over it and correcting all of their errors in red, and then showing and explaining them to me.
The thing was covered in red, and she replied something like “Why in the world would we want you to do our advertising?” My mom and dad did all of that - even full page newspaper spots (back in the 70’s). Although I imagine they had help with the layout.
I was feeling so alone. Thank you.