rubberdont
rubberdont

Reputation: 474

Capitalize First Letter of Month in datePicker

I have my datePicker in my app and in English language the first letter of the month is in Uppercase. when I change my device language into Español it turn into lowercase. Just like enero, febrero, marso ... and so on. I wanted to Capitalize the first letter of the month

datePicker.init(datePicker.getYear(), datePicker.getMonth(), datePicker.getDayOfMonth() + 1, null);

Upvotes: 1

Views: 1902

Answers (2)

Doug Simonton
Doug Simonton

Reputation: 1031

Apparently months in Spanish are not supposed to be capitalized, so what you are seeing is the proper case. Studyspanish.com

Upvotes: 0

Santosh Kathait
Santosh Kathait

Reputation: 1444

try this

String str=datePicker.getMonth().tostring;
        str = str.toLowerCase();
        str = Character.toString(str.charAt(0)).toUpperCase()+str.substring(1);

Upvotes: 1

Related Questions