Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

108
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda