Material-ui-pickers: Why we need "ampm" property if moment (and other) already has this setting in locale config?

Created on 27 Oct 2018  路  4Comments  路  Source: mui-org/material-ui-pickers

So if we have 24 hour format set in moment locale configuration then we still need to specify ampm={false} on every picker.

enhancement

Most helpful comment

Locale does not contain information about am pm.
But you are right we can lift up the am pm settings globally. Passing props to Provider?

That should be done 馃憤

All 4 comments

But actually - Do we have?

If really - it would be nice enhancmenet

moment:

  • configure (change specific locale or just switch to another locale):
moment.updateLocale('en', {
  longDateFormat: {
    LT: 'HH:mm',   // 24
    LT: 'h:mm A',  // 12
  },
});
  • usage: dt.format('LT')

luxon:

  • manual
  • settings default: Settings.defaultLocale = 'fr';
  • usage: dt.toLocaleString(DateTime.TIME_SIMPLE)

date-fns

  • set locale: window.__localeId__ = 'fr' (ref)
  • usage: dt.format('p') (ref)

Locale does not contain information about am pm.
But you are right we can lift up the am pm settings globally. Passing props to Provider?

That should be done 馃憤

Finally got to the point that it will be a bad way. Closing this

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danmce picture danmce  路  3Comments

benneq picture benneq  路  3Comments

killjoy2013 picture killjoy2013  路  3Comments

callmeberzerker picture callmeberzerker  路  3Comments

sakulstra picture sakulstra  路  3Comments