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

163
Views
How to add handleChange method on jalali-react-datepicker

I am using jalali-react-datepicker and I want to add handleChange and onChange, I wrote my code and logic but it doesn't work:

import React, { useContext, useState } from "react";
import { DatePicker } from "jalali-react-datepicker";
import { Label } from "./../../globalStyle";
import moment from "jalali-moment";

const DatePick = ({ question, handleChange }) => {
  const [date, setDate] = useState(moment().locale("fa").format("YYYY/MM/DD"));
  question.answer = date;

  return (
    <div>
      <Label>{question.text}</Label>
      <DatePicker
        value={date}
        selected={date}
        onChange={(date) => setDate(date)}
      />
    </div>
  );
};

export default DatePick

And I can't take the new value of datepicker and I don't know how to fix it.

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!