babakhani / pwt.datepicker

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

Plain English numbers #249

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi, after reading https://github.com/babakhani/pwt.datepicker/issues/141 apparently it's not possible to have Persian localization, but English digits? The persianDigit flag doesn't seem to work.

Can I get this formatting: 2 شهریور 1397 And not: ۲ شهریور ۱۳۹۷

Cheers!

babakhani commented 6 years ago

@loolooyyyy to do this you need reading this documents http://babakhani.github.io/PersianWebToolkit/doc/persian-date/#tolocale http://babakhani.github.io/PersianWebToolkit/doc/datepicker/options/#configformatterunixdate if you need more help please reopen this issue. good luck.

masoodvahid commented 4 years ago

سلام ببخشید من در استفاده از این کتابخانه تازه کار هستم . متاسفانه متوجه نشدم که چطور باید در تنظیمات کاری کنم که تمامی تقویم فارسی بماند و فقط اعداد در اینپوت به لاتین تغییر کنند. اعداد فارسی در اعتبار سنجی فرم ها ایجاد اشکال می کنند.

تشکر از لطف شما

AmirRezaM75 commented 3 years ago

@masoodvahid I use this approach

formatter: function(unix) {
    var date = new persianDate(unix);
    var gregorian = date.toLocale('en').toCalendar('persian');
    return gregorian.format("YYYY-MM-DD");
}