Skip to content


Cleanup date formats that specify the same field multiple times.
Browse files Browse the repository at this point in the history
One of the usages was almost always meant to be something else. Most commonly the format reuses "m" (minutes of hour) instead of "M" (month of year) or "s" (second of minute) instead of "S" (milliseconds).

Eg: "mm/dd/yyyy hh:mm:ss.sss" instead of "MM/dd/yyyy hh:mm:ss.SSS"


PiperOrigin-RevId: 571995047
  • Loading branch information
Material Design Team authored and drchen committed Oct 10, 2023
1 parent 93360a5 commit f1da3c3
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -231,13 +231,13 @@ public void textFieldPlaceholder_usesDefaultFormat() {

public void textFieldPlaceholder_usesCustomFormat() {
singleDateSelector.setTextInputFormat(new SimpleDateFormat("kk:mm:ss mm/dd/yyyy"));
singleDateSelector.setTextInputFormat(new SimpleDateFormat("kk:mm:ss MM/dd/yyyy"));
View root = getRootView();
((ViewGroup) activity.findViewById(;

TextInputLayout textInputLayout = root.findViewById(;

assertThat(textInputLayout.getPlaceholderText().toString()).isEqualTo("kk:mm:ss mm/dd/yyyy");
assertThat(textInputLayout.getPlaceholderText().toString()).isEqualTo("kk:mm:ss MM/dd/yyyy");

Expand Down

0 comments on commit f1da3c3

Please sign in to comment.