1

This calendar is built on Angular with material Design, I need same the same output when I change my locale to ar-SA in react with react-datepicker

When I am changing locale to "ar-SA"(Arabic- Saudi Arabia), it is just placing the items from right to left but not changing the numbers and text in Arabic.

I have tried through this code.

<DatePicker
      locale="ar-SA"
      dateFormat="dd/MM/yyyy"
      selected={new Date()}
      popperPlacement="top-end"
      onChange={(date) => alert(date)}
      />

I have also tried some alternative to translate the date through the following:

import { FormattedDate } from "react-intl"

but this is also not helpful.

I want full Arabic support on same calendar with the text and numbers in Arabic.

James Z
  • 12,209
  • 10
  • 24
  • 44
  • have you tried this? import { registerLocale} from "react-datepicker"; import sa from 'date-fns/locale/ar-SA'; registerLocale('sa', sa) – Ehsan Oct 13 '22 at 14:59
  • I have tried this, but numbers are not getting changed, other things are changed, but mainly I need the translation of numbers also. – Nadeem Akram Oct 14 '22 at 07:08

0 Answers0