Cleanup date formats that specify the same field multiple times.

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"

#busy-beavers

PiperOrigin-RevId: 571995047
This commit is contained in:
Material Design Team 2023-10-09 11:33:37 -07:00 committed by drchen
parent 93360a5a5d
commit f1da3c384f

View File

@ -231,13 +231,13 @@ public class SingleDateSelectorTest {
@Test
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(android.R.id.content)).addView(root);
TextInputLayout textInputLayout = root.findViewById(R.id.mtrl_picker_text_input_date);
assertThat(textInputLayout.getPlaceholderText().toString()).isEqualTo("kk:mm:ss mm/dd/yyyy");
assertThat(textInputLayout.getPlaceholderText().toString()).isEqualTo("kk:mm:ss MM/dd/yyyy");
}
@Test