I have a date and want to display the date with the suffix th, st, rd, etc.
Here is my dart code.
int year = date.year;
int month = date.month;
int day = date.day;
DateTime dateSelected = new DateTime(year, month, day);
var formatter = new DateFormat('EEEE MMMM dd, yyyy');
displayDate = formatter.format(dateSelected);
This displays dates as "Wednesday April 23, 2014" for example, but I need "Wednesday April 23rd, 2014".
I'm using the intl package.
import 'package:intl/intl.dart';