0

For material date picker textfield for entering date, does it allow you to customize it such that it will automatically add / after 2 digits, example: the date 02/22/1955, so if i enter 22 then it will automatically add / followed by me entering 22 . after which it will add / and finally the year. basically like this : ( currently i have to manually enter / after the digits) enter image description here

Angela Heely
  • 419
  • 2
  • 4
  • 13
  • Do you want to do it automatically? – hungcuiga1 Jun 16 '21 at 13:07
  • yeah, i wanna do it automatically as in it should auto enter as i go add in digits – Angela Heely Jun 16 '21 at 13:10
  • Can [link](https://stackoverflow.com/questions/16889502/how-to-mask-an-edittext-to-show-the-dd-mm-yyyy-date-format) help you ? My code is show calendar and select the date on the calendar. – hungcuiga1 Jun 16 '21 at 13:18
  • i wonder if its possible to update material design component, override their default component somehow. Its possible to easily customize the regular native date picker but material design seems to be very restricted, just wondering how to override existing layouts and code/functions for material design date picker somehow – Angela Heely Jun 16 '21 at 13:31
  • Based on this [issue ticket](https://github.com/material-components/material-components-android/issues/939), I think you are looking at modifying: https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/datepicker/SingleDateSelector.java Realize that edge cases exist (like what do you see when you remove the date, but not month or year) as noted in @hungcuiga1 link. – Morrison Chang Jun 16 '21 at 14:06
  • but is it even possible to update the material design view to show input masking? – Angela Heely Jun 16 '21 at 14:20

0 Answers0