mirror of
https://github.com/material-components/material-components-android.git
synced 2026-02-20 08:39:55 +08:00
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:
parent
93360a5a5d
commit
f1da3c384f
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user