Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

513
Visualizações
MUI 5 and react 18. How to mask the entered date with (*) asterisk symbol in mui datepicker

In my application, there is an option for capturing date of birth of user. Once user entered date or selected from calendar, I want to show number as asterisk.

Package version:

"@mui/material": "^5.6.2",
"@mui/lab": "^5.0.0-alpha.71",
"date-fns": "^2.24.0",
"react": "^18.0.0",

Example:

If user enter DOB 05/11/1990 (mm/dd/yyyy), then need to show like **/**/1990.

Actual:
enter image description here

Expected:
enter image description here

Code:

return (
    <LocalizationProvider dateAdapter={AdapterDateFns}>
        <Grid container justifyContent="space-around">
            <DatePicker
                margin="normal"
                id="date-picker-dialog"
                label={label}
                inputFormat={format ?? 'MM/dd/yyyy'}
                mask={mask ?? "__/__/____"}
                onChange={handleDateChange}
                value={selectedDate}
                InputAdornmentProps={{ position: 'start' }}
                minDate={minDate}
                maxDate={new Date(maxdate)}
                shouldDisableDate={disableCustomDate}
                disablePast={disablePastDate === "true" ? true : false}
                views={views ?? [ 'year', 'month', 'day' ]}
                InputProps={{ "data-testid": "datePicker" }}
                renderInput={(props) => (
                    <TextField
                        {...props}
                        {...otherProps}
                        fullWidth={true}
                        placeholder={placeholder}
                        error={error ? error : errorTF}
                        helperText={error ? helperText : helperTextTF}
                        type="password"
                        variant="standard" />
                )}
            />
        </Grid>
    </LocalizationProvider>
);
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda