smartstore / SmartStoreNET

Open Source ASP.NET MVC Enterprise eCommerce Shopping Cart Solution
http://www.smartstore.com/en/net
GNU General Public License v3.0
2.64k stars 1.47k forks source link

Discrepancies between moment.js and .NET Framework date handling #1382

Closed mahdi87gh closed 6 years ago

mahdi87gh commented 6 years ago

Hi everyone. I have this problem when I change the site language to anything other than English, I can not save items which have CreatedOn and EditedOn fields. I get these errors:

What should I do?

muratcakir commented 6 years ago

You seem to have changed the language to arabic. Other than English does not quite fit here. Where is the language pack from? And what exactly is the language?

You should provide more details.

mahdi87gh commented 6 years ago

The language is Persian (fa-ir)

pineportal commented 6 years ago

datetime.chtml Changing the format of history is solved by the following problem ddddd This problem is due to the server language format format = PickTime ? "YYYY/MM/DD HH:mm" : "YYYY/MM/DD";

muratcakir commented 6 years ago

Could you please have a look at moment.js localization file for Persian, fa.js, and tell me whether the content is correct?

muratcakir commented 6 years ago

I fixed it, but unfortunately it's impossible to display native (arabic) digits in the date picker control. Although the date picker is capable of doing so, .NET Framework cannot parse string dates with native digits. We'd have to change the ModelBinder for this and implement very hackish code.

We have decided against it. I hope it's ok :-)

pineportal commented 6 years ago

Thank you for solving the problem Persian Calendar Is Jalali is beter moment.js for jalaali instead fa.js https://github.com/jalaali/moment-jalaali/blob/master/build/moment-jalaali.js or https://github.com/fingerpich/jalali-moment

and persian datetimePicer is https://github.com/beygi/bootstrap-persian-datetimepicker or https://github.com/Mds92/MD.BootstrapPersianDateTimePicker

and https://en.wikipedia.org/wiki/Jalali_calendar