Code Monkey home page Code Monkey logo

Comments (2)

flaviendelangle avatar flaviendelangle commented on August 26, 2024 2

I think I got the problem.
Do is the format to display the day of the month with as 1st / 2nd etc...
So it is a section of content type digit-with-letter

The sections of content type do not have a leading zero.
BUT in the french locale, the ordinal is only added for 1 (not sure why, 2ème exists in french...)

  ordinal: (n) => {
    const o = n === 1 ? 'er' : ''
    return `${n}${o}`
  }

So we end up in a scenario where we render 2, not 02 or 2ème.
This is a classic "onChange is not fired because you press 2 while selecting 2".

The only solution I see is to add the leading zero. Not sure exactly how complex this would be, always adding a leading zero on sections with content type digit-with-letter would clearly be controversial...
If we want to only add it when there is no ordinal, then we need to stop using section.hasLeadingZerosInInput and instead check if a section should have a leading zero based on its current value.

from mui-x.

michelengelen avatar michelengelen commented on August 26, 2024

I can confirm that the input of 22 does not work, all others work though.
@pcourant thanks for raising this. I will add this to the board!

from mui-x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.