babakhani / pwt.datepicker

Javascript jalaali calendar capable datepicker widget
http://babakhani.github.io/PersianWebToolkit/datepicker
614 stars 140 forks source link

عدم نمایش صحیح سال، وقتی مقدار تکست باکس با فونت انگلیسی پر می شود #354

Closed milad-i closed 3 years ago

milad-i commented 3 years ago

اگر مقدار تکست باکسی که دیت پیکر به آن متصل است از طریق دیتابیس پر شود و اعداد با فونت انگلیسی باشند، دیت پیکر سال اشتباهی را نمایش میدهد

DP1

mort3za commented 3 years ago

Font has nothing to do with values. I guess you're passing a wrong date to the field.
You may want to fork this pen and reproduce your issue, so we can help:
https://codepen.io/mort3za/pen/oNLvvPw

milad-i commented 3 years ago

DP2

این فیلد های توی دیتابیس هست. کادر سبز رنگ تاریخی هست که با کاراکترهای فارسی ذخیره شده که این مورد زمان فراخوانی مشکلی ندارد. کادر قرمز رنگ تاریخی هست که با کاراکترهای انگلیسی ذخیره شده. این مورد زمان فراخوانی سال اشتباه رو نمایش میده.

با توجه به فراخوانی دیتا از دیتابیس، نمیتونم توی codepen فورک کنم

mort3za commented 3 years ago

This is a client side plugin. You always can replace backend data with sample data to test client side things.

BehrouzTorabi commented 3 years ago

This is a real bug and closed with the wrong reason, A bug is shown when the following option is configured: "calendar": { "persian": { "locale": "en" } }

BehrouzTorabi commented 3 years ago

Font has nothing to do with values. I guess you're passing a wrong date to the field. You may want to fork this pen and reproduce your issue, so we can help: https://codepen.io/mort3za/pen/oNLvvPw

It's not about the font. when the charset is English it's happening.

image

mort3za commented 3 years ago

@BehrouzTorabi See these examples: https://codepen.io/mort3za/pen/MWoabYV

The only difference of them is initialValueType: 'gregorian', and initialValueType: 'persian',.
The option you mentioned just changes the language not the type of calendar. Uncomment "calendar": { "persian": { "locale": "en" } } in the link above and see the change.

You're always welcome to reopen the issue or create a new one.

BehrouzTorabi commented 3 years ago

That's right, my mistake, thanks