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

153
Views
obtenga los días del mes persa en el paquete dayjs

escribo una función para obtener los días del mes. Uso dayjs y jalaliday para construir esta función.

Mi código:

 import dayjs from "dayjs"; import jalaliday from 'jalaliday' dayjs.extend(jalaliday) dayjs.calendar('jalali').locale('fa') export function GetMonth(month =dayjs().month()){ const year = dayjs().year(); const FirstDayOfTheMonth= dayjs(new Date(year ,month,1)).calendar('jalali').day(); let CurrentMonthCount =0 -FirstDayOfTheMonth; const DaysMatrix =new Array(5).fill([]).map(()=>{ return new Array(7).fill(null).map(()=>{ CurrentMonthCount++ return dayjs(new Date(year,month,CurrentMonthCount)).calendar('jalali').locale('fa') }) }); return DaysMatrix; }

uso esta función en mi componente de reacción y, cuando registro esta función, me da una fecha en inglés como esta:

mi consola.table(GetMonth())

solo el año es correcto. ¿Cómo puedo obtener detalles de la fecha persa?

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

0

prueba este hombre:

 import dayjs from "dayjs"; import jalaliday from 'jalaliday' dayjs.extend(jalaliday) export function GetMonth(month = dayjs().month()+1) { const year = dayjs().year(); const FirstDayOfTheMonth = dayjs(new Date(year, month, 1)).day(); let CurrentMonthCount = 0 - FirstDayOfTheMonth; const DaysMatrix = new Array(5).fill([]).map(() => { return new Array(7).fill(null).map(() => { CurrentMonthCount++ return dayjs(new Date(year,month,CurrentMonthCount)).calendar('jalali').locale('fa').format('DD MMMM YYYY') }) }); return DaysMatrix }
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!