I use [formatter setDateFormat:@"EEEE, MMMM dd, h:mma"];
So EEEE - show for me a name of the day. But I want to display Today or Tomorrow or Yesterday instead and in another cases display name of the day.
So I want to use format like I've described above an example:
Monday, OCT 2, 4:33PM
but if the Monday is today I want to show:
Today, OCT 2, 4:33PM
If Monday was yesterday it has to show:
Yesterday, OCT 2, 4:33PM
If use this code you suggested as duplicated:
formatter.dateStyle = NSDateFormatterShortStyle;
formatter.timeStyle = NSDateFormatterShortStyle;
formatter.doesRelativeDateFormatting = YES;
10/2/15, 4:33PM which is not so I want to expect.
In example you point as duplicated: how to use NSDateFormatter to see "Today" string there is 2 answer second one it's just display name of the day but not "TODAY" for example, so first answer there I've described above why it does not work, so it's not so right suggestion to say that my question duplicate this link. Maybe it can duplicate another link, but not this one.
Of course I can parse manually received string from formatter to find a day and replace it with "TODAY" if needed, but I just asked if formatter can make it automatically?