Results 1 to 2 of 2

Thread: Using a different calendar for DatePicker control

  1. #1

    Default Answered: Using a different calendar for DatePicker control

    Hi,

    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:

    https://www.sencha.com/forum/showthr...rt-month-names

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

    http://keith-wood.name/calendars.html

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

  2. Hi--

    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:

    http://docs.sencha.com/extjs/4.2.1/#...m.field.Picker
    http://docs.sencha.com/extjs/4.2.1/#...orm.field.Date
    http://docs.sencha.com/extjs/4.2.1/#...xt.picker.Date

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

  3. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    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:

    http://docs.sencha.com/extjs/4.2.1/#...m.field.Picker
    http://docs.sencha.com/extjs/4.2.1/#...orm.field.Date
    http://docs.sencha.com/extjs/4.2.1/#...xt.picker.Date

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

Similar Threads

  1. Calendar Control
    By nMehmood in forum Ext 5: Q&A
    Replies: 1
    Last Post: 26 Feb 2015, 7:47 AM
  2. Calendar Control
    By offshoreteam in forum Ext: Q&A
    Replies: 2
    Last Post: 13 Apr 2013, 4:16 AM
  3. Calendar control
    By webfriend13 in forum Ext: Q&A
    Replies: 1
    Last Post: 23 Oct 2012, 11:00 PM
  4. Need Calendar (datepicker) example
    By funz51 in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 12 Feb 2008, 8:55 AM
  5. Calendar control in ext
    By sujee in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 9 Apr 2007, 4:36 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •