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

109
Views
Hebrew date format with momentjs

I changed locale to 'he' and use this format:

moment().format('D MMM') 

it formated like this: 3 אפר׳ but I want to show date with this symbol 'ב' which means (3 in Apr) like this: 3 באפר׳

How can I make this? Thanks in advance

about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

The format string can contain other characters than just date part placeholders, you can do it directly:

moment.locale('he');

console.log(moment('2022-04-03').format('D בMMM'));
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.3/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.3/locale/he.js"></script>

about 4 years ago · Juan Pablo Isaza Report

0

You can do this without moment at all. The Intl object does this without any additional libraries in modern JS. If you want to support IE then you might need moment, if not, I'd recommend using Intl over moment. Not least of which, because moment is deprecated.

const intl = new Intl.DateTimeFormat('he', {month: "short", day:"numeric"});
console.log(intl.format(new Date('2022-04-03')));

about 4 years ago · Juan Pablo Isaza Report

0

I dont think that there is a built in method for that in moment.js, but you can use regex:

moment().format('D MMM').replace(/\d+? /, '$&ב')

about 4 years ago · Juan Pablo Isaza Report
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!