Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

75
Views
dayjs localizedFormat not showing special characters

I used moment to format date strings for a lot of different languages. Now I want to migrate from moment to dayjs so I created a new function that should create me localized date strings like this:

import * as dayjs from 'dayjs';
import * as localizedFormat from 'dayjs/plugin/localizedFormat';
import 'dayjs/locale/ar';
// ... 57 more locales

dayjs.extend(localizedFormat);

const formatDate = (date:Date, locale:string) => {
    return dayjs(date).locale(locale).format("L");
};

for 42 locales it works fine but the ones with e.g. asian or arabic characters are not properly displayed. When I did the same previously with moment using moment(date).locale(locale).format("L") instead I got a proper response. For e.g. arabic(ar) I got with moment ١٧/‏١/‏٢٠٢٢ and with dayjs 01/17/2022 but if I open the imported locale in dayjs/locale/ar I can see that they have strings with these characters in place and just don't use them.

This happens for ar, bn, fa, hi, km, my, pa, si and a couple of other ones that have e.g. days and months twisted, but that I could change myself.

Is there anything I do wrong?

Thanks in advance :)

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!