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

229
Views
Intento obtener el momento para convertir el mes en Número, pero obtengo un valor incorrecto

Necesito ayuda para averiguar por qué el momento devuelve un valor incorrecto. Este es el problema al que me enfrento. En cualquier momento puedo obtener un valor en francés o en inglés. Por ejemplo, si cMon = "août 2022" cuando se ejecuta este código, cNMon devuelve 2 en lugar de 8

Intenté pasar la configuración regional, pero el problema es que debe poder aceptar francés o inglés y mostrar el valor correcto.

Línea de código mecanografiado

 import moment from 'moment'; private static async getCurrent(actor: Actor): Promise<{ Mon: string, Year: number, MonStr: string, NMon: number}> { let cMon = await actor.requestTo(GetElementText.for(cmon)); let Year = Number(currMonthText.split(" ")[1]); let MonStr = currMonthText.split(" ")[0]; let cNMon: number = Number(moment().month(currMonthStr.trim()).format("M")); return { cMon, Year, MonStr, NMon } }
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!