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

342
Views
TypeError: (0, _dayjs.Dayjs) no es una función

Quiero reemplazar momentjs con dayjs ahora mismo. Primero agregué las dependencias:

 "dayjs":"1.10.7"

luego importa los dayjs así:

 import { Dayjs } from 'dayjs';

comience el mes usando este fragmento de código:

 const fullDateTimeFormat = 'YYYY-MM-DD HH:mm:ss:SSS'; const startOfCurrentMonth = Dayjs().startOf("month").format(fullDateTimeFormat);

pero muéstrame este error:

 TypeError: (0 , _dayjs.Dayjs) is not a function selectMonthListState src/components/SelectData/index.js:112 109 | const days = getMonthDay(year, month); 110 | const prevMonthDays = getMonthDay(year, month-1); 111 | const startDateValue = `${moment(year + '-' + (month-count +1) + '-01').format(dateFormat)} 00:00:00:000`; > 112 | const startOfCurrentMonth = Dayjs().startOf("month").format(fullDateTimeFormat); | ^ 113 | const endDateValue = count ===1? `${moment(year + '-' + (month) + '-' + prevMonthDays).format(dateFormat)} 23:59:59:999`: `${moment(year + '-' + (month+1) + '-' + days).format(dateFormat)} 23:59:59:999`; 114 | 115 | setSelectDate([moment(startDateValue, rPickerFormat), moment(endDateValue, rPickerFormat)]);

que debo hacer para solucionar este problema? ¿Me estoy perdiendo de algo?

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

0

Yo lo uso así:

 import dayjs from 'dayjs'; const startOfCurrentMonth = dayjs().startOf("month").format(fullDateTimeFormat);

obras.

about 4 years ago · Juan Pablo Isaza Report

0

prueba esto:

 import dayjs from 'dayjs'; const relativeTime = require('dayjs/plugin/relativeTime'); dayjs.extend(relativeTime);
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!