SpongeBobSun / mCalendarView

Customizable & Shrinkable Calendar Widget for Android
Apache License 2.0
243 stars 73 forks source link

WeekColumnView Translate #11

Closed rodriggoarantes closed 8 years ago

rodriggoarantes commented 8 years ago

Hi man, we have the possibility of translate the names that days of week in WeekColumnView?

I saw the code of WeekColumnView, it is used the method "ExpCalendarUtil.number2Week", but the names are in hardcode.

Thanks

SpongeBobSun commented 8 years ago

Okay, I'll fix it once I got time. Been busy on work recently. I'll assign this issue to my homie see if he got time for this.

Thanks. Bob.

来自 魅族 MX4 Pro

-------- 原始邮件 -------- 发件人:Rodrigo Arantes notifications@github.com 时间:周二 1月19日 07:31 收件人:SpongeBobSun/mCalendarView mCalendarView@noreply.github.com 主题:[mCalendarView] WeekColumnView Translate (#11)

Hi man, we have the possibility of translate the names that days of week in WeekColumnView? I saw the code of WeekColumnView, it is used the method "ExpCalendarUtilnumber2Week", but the names are in hardcode Thanks —Reply to this email directly or view it on GitHub.

rodriggoarantes commented 8 years ago

Ok, your lib is very good, i made this code for resolve my problem, check if it is good for your lib:

/* ExpCalendarUtil.java * The number to Week * @param number - Number day of Week (on the code Sunday is equal 7) * @return [String] - abbreviated name of the days of the week / public static String number2Week(int number) { if (number < 1 || number > 7) return null; //Day of Week 1-7 if (number == 7) { number = 1; } else { number = number + 1; } final DateFormatSymbols symbols = new DateFormatSymbols(); //use user locale final String nameDayOfWeek = symbols.getShortWeekdays()[number]; //Short name or getWeekdays for complete name return nameDayOfWeek.toUpperCase(); //name to uppercase }

Thanks.

SpongeBobSun commented 8 years ago

Cool! I've merged your code into mine. Thanks a lot ! And I've put you in the credit list of this project! Thanks again :)