-
Notifications
You must be signed in to change notification settings - Fork 251
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
Localized date rendering #1013
Localized date rendering #1013
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1013 +/- ##
============================================
+ Coverage 84.49% 84.51% +0.01%
Complexity 608 608
============================================
Files 133 134 +1
Lines 10277 10275 -2
Branches 753 756 +3
============================================
Hits 8684 8684
+ Misses 1218 1215 -3
- Partials 375 376 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vvikramraj! Great job writing your first PR in the repo :)
Left a few comments - also, can you please think about handing this for the date time picker? Either same PR or create a follow up PR/issue.
...droid/fhir/datacapture/views/QuestionnaireItemDatePickerViewHolderFactoryInstrumentedTest.kt
Outdated
Show resolved
Hide resolved
...va/com/google/android/fhir/datacapture/views/QuestionnaireItemDatePickerViewHolderFactory.kt
Show resolved
Hide resolved
...va/com/google/android/fhir/datacapture/views/QuestionnaireItemDatePickerViewHolderFactory.kt
Outdated
Show resolved
Hide resolved
...va/com/google/android/fhir/datacapture/views/QuestionnaireItemDatePickerViewHolderFactory.kt
Outdated
Show resolved
Hide resolved
...va/com/google/android/fhir/datacapture/views/QuestionnaireItemDatePickerViewHolderFactory.kt
Outdated
Show resolved
Hide resolved
...va/com/google/android/fhir/datacapture/views/QuestionnaireItemDatePickerViewHolderFactory.kt
Outdated
Show resolved
Hide resolved
demo/src/main/java/com/google/android/fhir/demo/PatientDetailsViewModel.kt
Outdated
Show resolved
Hide resolved
...va/com/google/android/fhir/datacapture/views/QuestionnaireItemDatePickerViewHolderFactory.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good @vvikramraj - just one comment to update the import.
get() { | ||
val date = Date.from(atStartOfDay(ZoneId.systemDefault())?.toInstant()) | ||
return if (isAndroidIcuSupported()) | ||
DateFormat.getDateInstance(DateFormat.DEFAULT).format(date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be android.icu.text.DateFormat
and not java.text.DateFormat
https://developer.android.com/guide/topics/resources/internationalization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-| Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* Localized date rendering * Addressing code review comments * Switching between DateFormat and SimpleDateFormat based on SDK version * Fixes from running spotless check and apply * Fixing imports
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #898
Description
Change to display dates in a locale-specific
DateFormat.DEFAULT
format.Alternative(s) considered
NA
Type
Choose one: Bug fix
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project./gradlew check
and./gradlew connectedCheck
to test my changes locally