-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Localize Date Format #501
Localize Date Format #501
Conversation
@alamkanak Small PR to localize the format of the dates in headers. Would be nice to see it merged :-) Cheers! |
This is not needed anymore, because I did it and it will use the locale of the device to decide which format is best, including which sign to use (some use "-" instead of "/" for example). |
@AndroidDeveloperLB thanks for your comment! How can I make use of the improvements you did? Are they published somewhere? Can I add them in my gradle dependencies? |
@accandme Well, first maybe try out my repository (here).
You can read all of the changes I've made over the past weeks. I think it's worth it. As for using on gradle, not sure. Maybe using Jitpack? Not sure... Currently the issues I've having that I wish others could help me with, are:
I would appreciate it if you could also help with this. I've worked a lot recently to improve and fix this library. It's too complex and much harder to modify than I thought, but it's almost the only library I've found |
BTW, here's the relevant code for the formatting (function is "getWeekdayWithNumericDayAndMonthFormat") : |
@AndroidDeveloperLB thanks a lot for your detailed response, and for all the work on this library! Regarding the horizontal scrolling, I worked around it by using a ViewPager, and creating several copies of WeekView that do not scroll horizontally. The only dirty hack was to synchronize the vertical scroll state across the different instances. I did not do anything to support RTL for now.
Thanks again very much! |
@accandme The ViewPager has a disadvantage as you wrote, that you need to sync the vertical state . My repository has a solution instead of a ViewPager, which someone has contributed (not me). About jitpack, I'm not sure if it works the way I've made it. |
@AndroidDeveloperLB thanks for your quick reply! My dirty hack was to broadcast the current scroll position to the two "instantiated but hidden" views (left and right) at a regular interval. It is not perfect of course, but it works okay. So far, in my deps, I am still using the original WeekView repo (alamkanak). I'll let you know if I face problems when I migrate to using your modified version. Cheers, and thanks for the good work! |
@accandme OK thanks. |
The huge changes I've suggested were approved? Including everything? Kotlin and all? |
Some locales format dates as
dd/MM
rather thanM/dd
.This PR localizes the date format.