Skip to content
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

Display dates from date or datetime widgets and times from time or datetime widgets using the phone locale #897

Closed
lognaturel opened this issue Apr 14, 2017 · 8 comments · Fixed by #974

Comments

@lognaturel
Copy link
Member

lognaturel commented Apr 14, 2017

Currently, Date, Time and DateTime widgets are displayed using the getDisplayText method on the IAnswerData that they represent. That method does not respect the device's locale.

For example, a date widget with appearance no-calendar and the phone locale set to US English:
screen shot 2017-04-14 at 12 17 24 pm
The date should use the order 4/17/17. I think it would be even better using the LONG format -- April 17, 2017 in US English or 17 avril 2017 in FR French. For times I like the MEDIUM format -- 7:03:47 AM in US English or 07:03:07 in FR French. See docs here.

Similarly, in the jump menu (FormHierarchyActivity):
screen shot 2017-04-14 at 12 17 37 pm

This form is a good one to use for seeing the problem.

This should be easy enough to address for the widgets but it's somewhat annoying for the jump menu. One simple approach would be to add special cases in FormEntryPrompt's getAnswerText. It would be good to describe some different approaches here so we can discuss.

@nmpatsal
Copy link
Contributor

Let us to take it with @nikialexopoulou because we already started in this direction.

@lognaturel
Copy link
Member Author

That sounds good @nmpatsal @nikialexopoulou. It does look like a simple issue but it's somewhat more complicated because it touches JavaRosa! I'm looking forward to seeing how you propose to address it.

@lognaturel lognaturel added this to the April 2017 milestone Apr 18, 2017
@lognaturel
Copy link
Member Author

I would recommend addressing the date display on the widgets themselves first as one pull request. I think that will be relatively straight forward and we do want to include that in the April release. The FormHierarchyActivity part is more complicated and can wait since that behavior has been there for a long time.

@lognaturel
Copy link
Member Author

There's one more requirement for this that I just thought of. The date display should respect the appearance. That is, if the appearance is month-year, the date should be displayed as April 2017, for example, NOT as April 1, 2017.

Do you think you can get the first part of this done by Monday 4/24? If not, let us know so someone else can complete it before the code freeze next Wednesday!

@nikialexopoulou
Copy link

@lognaturel we'll try to make it. If we see that we can't do it, we'll inform you by tomorrow.

@nikialexopoulou
Copy link

@lognaturel we can't complete the issue, so if anyone else would like to take it, please do. I'm sorry we're late but we were trying till today.

@lognaturel
Copy link
Member Author

Thanks for letting us know, @nikialexopoulou.

@grzesiek2010
Copy link
Member

@lognaturel I have fixed this locally but I would like to merge #935 first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants