babakhani / pwt.datepicker

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

Persian date-time to the equivalent Gregorian date-time #166

Closed torgheh closed 5 years ago

torgheh commented 6 years ago

We usually need to store dates in the western calendar format, meaning that before submitting a form we have to be able to convert the Persian date-time to the equivalent Gregorian date-time.

Right now there is no easy way to do this. For example using altField is already complicated since you have to define a formatter, but the real problem comes when you have more than one date-time input and there is no way you can pragmatically define the altField. You might suggest using onSelect event, but that event doesn't cover the time change or manual changes to the input by user typing the date-time.

babakhani commented 6 years ago

@torgheh for this purpose, you must implement your own initializer that pragmatically defines the altField.