react-native-calendars icon indicating copy to clipboard operation
react-native-calendars copied to clipboard

field today: "today", not work

Open glaulher opened this issue 3 years ago • 3 comments

when using LocaleConfig and setting the field:

today: "hoje",

returns error in vscode:

Object literal may only specify known properties, and 'today' does not exist in type 'locale_detail'.ts(2322)

code example:

LocaleConfig.locales['pt-br'] = {
  monthNames: [
    'Janeiro',
    'Fevereiro',
    'Março',
    'Abril',
    'Maio',
    'Junho',
    'Julho',
    'Agosto',
    'Setembro',
    'Outubro',
    'Novembro',
    'Dezembro',
  ],

  monthNamesShort: [
    'Jan',
    'Fev',
    'Mar',
    'Abr',
    'Mai',
    'Jun',
    'Jul',
    'Ago',
    'Set',
    'Out',
    'Nov',
    'Dez',
  ],

  dayNames: [
    'Domingo',
    'Segunda',
    'Terça',
    'Quarta',
    'Quinta',
    'Sexta',
    'Sábado',
  ],

  dayNamesShort: ['DOM', 'SEG', 'TER', 'QUA', 'QUI', 'SEX', 'SÁB'],

  today: "Hoje",
};

glaulher avatar Jan 30 '22 13:01 glaulher

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 30 '22 17:04 stale[bot]

monthNamesShort also does not work. Has there been any resolution to this issue?

I have imported the LocaleConfig into my project and am using dayNamesShort which works perfectly like so:

const SHORT_WEEK_DAYS = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];

LocaleConfig.locales[LocaleConfig.defaultLocale].dayNamesShort =
    SHORT_WEEK_DAYS;

But using monthNamesShort in the same way does not do anything. this is what I have

const SHORT_MONTH_NAME = [
  'Jan',
  'Feb',
  'Mar',
  'Apr',
  'May',
  'Jun',
  'Jul',
  'Aug',
  'Sep',
  'Oct',
  'Nov',
  'Dec',
];

  LocaleConfig.locales[LocaleConfig.defaultLocale].monthNamesShort =
    SHORT_MONTH_NAME;

Using it like this also doesn't work:

LocaleConfig.locales[LocaleConfig.defaultLocale] = {
  monthNamesShort: SHORT_MONTH_NAME,
  dayNamesShort: SHORT_WEEK_DAYS,
};

Has anyone had this issue?

UPDATE:

I got around this issue by using monthNames instead of monthNamesShort

mazaherm avatar Jun 01 '22 08:06 mazaherm

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 04 '22 17:09 stale[bot]