For Example, with a date of 02/01 without date suffix.
Given an input parameter of en_US(locale), it will return February 1st.
Given an input parameter of fr_CA(locale), it will return février 1er.
Given an input parameter of zh_CN(locale), it will return 二月 1日.
The thing that I really expect is date with suffix by locale. I have searched some java source online and I can get English date with suffix by doing something like this.
switch (previousChar) {
case '1': {
return "th";
}
default: {
switch (lastChar) {
case '1':
return "st";
case '2':
return "nd";
case '3':
return "rd";
default:
return "th";
}
}
}
However, this is not enough. Because for different locales/languages, the suffix for date are different.
Any help will be really appreciated!