Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

چطور باید استیت رو هندل کرد و مقدار اینپوت رو گرفت ؟ #286

Open
alireza-asgharii opened this issue Mar 15, 2024 · 3 comments

Comments

@alireza-asgharii
Copy link

alireza-asgharii commented Mar 15, 2024

توی ابجکت ایونت چیزی نتونستم پیدا کنم . کسی میتونه راهنمایی کنه

@alireza-asgharii
Copy link
Author

این روش رو امتحان کردم تا یجایی کارمو راه انداخت
new Date(value).toLocaleDateString('fa-IR')

@alireza-asgharii
Copy link
Author

و این طور هم بهتر شد
new Date(value).toLocaleDateString("fa-IR", {
weekday: "long",
year: "numeric",
month: "long",
day: "numeric",
})}

میدونم چیز خاصی نداشت ولی من میخواستم از value استیت بگیرم که نتونستم.

@shahabyazdi
Copy link
Owner

سلام.
مقداری که در ایونت onChange ارسال میشه در حقیقت همون مقداری هست که باید در استیت ذخیره کنید. برای تبدیل این مقدار میتونید از متد toDate هم استفاده کنید.
https://shahabyazdi.github.io/react-multi-date-picker/fa/events/#onchange-(%D8%A7%D9%86%D8%AA%D8%AE%D8%A7%D8%A8%DA%AF%D8%B1-%D8%AA%DA%A9%DB%8C)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants