View Full Version : Using a different calendar for DatePicker control

27 Aug 2015, 9:46 PM

I'm using Ext.form.DateField control for date picker. I'm wondering if there is a way to use a different calendar as a base for date picker? In other words, I'd like to have some sort of localization. If the language is english, display Gregorian calendar from DatePicker. If the language is Arabic, use Hirji calendar.

I also tried to just override month day names like this:


but that won't work since in hirji calendar years differ from gregorian calendar.
There is also Jquery's implementation of different calendars:


is there a way to somehow use jquery's calendar with Ext's datepicker?
If no, any way how could I achieve this?

29 Aug 2015, 12:03 PM

Out of the box, this isn't possible to configure the built in date picker field to do this.

However, it's conceivably possible to create your own date picker field. By extending Ext.form.field.Picker, you could provide your own createPicker() method in which you could initialize the custom date picker that you'd like to use. From there, you'd have to wire up whatever calendar you're using so that various events (such as selections) would be properly communicated to the underlying picker field so that it would behave like the default date field. This will require a lot of customization--if you go down this road, I'd strong encourage you to study the contents of these three classes thoroughly:


I hope that helps give you a good place to start--thanks!