date-fns/locale#es TypeScript Examples

The following examples show how to use date-fns/locale#es. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Events.test.tsx    From react-calendar with MIT License 6 votes vote down vote up
test('Renders weekdays in spanish', () => {
  render(
    <MonthlyCalendarTest
      locale={es}
      events={[{ title: 'Call bob', date: new Date(2021, 3, 4) }]}
      currentMonth={startOfMonth(new Date(2021, 3, 1))}
      onCurrentMonthChange={() => true}
    />
  );

  //check that the month nav date is in chinese
  screen.getAllByText('domingo');
  screen.getAllByText('lunes');
  screen.getAllByText('martes');
  screen.getAllByText('miércoles');
  screen.getAllByText('jueves');
  screen.getAllByText('viernes');
  screen.getAllByText('sábado');
});
Example #2
Source File: index.tsx    From website with MIT License 5 votes vote down vote up
formatEventDate = (date: string | Date) => {
  return format(new Date(date), 'd  MMMM HH:mm ', { locale: es });
}
Example #3
Source File: TimeDisplay.tsx    From crosshare with GNU Affero General Public License v3.0 5 votes vote down vote up
localeMap: Record<string, Locale> = { es, it, pseudo: es }