Results 1 to 2 of 2

Thread: Cumtomize datepickerfield

  1. #1
    Sencha Premium User
    Join Date
    Aug 2015
    Posts
    6

    Default Cumtomize datepickerfield

    I have my datepickerfield where month and year can be picked:

    Code:
    {
        xtype: 'datepickerfield',
        name: 'expiryDate',
        placeHolder: 'Exp. Date',
        dateFormat: 'm/Y',
        picker: {
            yearFrom: new Date().getFullYear(),
            yearTo: (new Date().getFullYear()) + 10,
            slotOrder: ['month', 'year']
        },
        margin: '0 10 0 0'
    }
    Screenshot:
    Screen Shot 2015-08-24 at 4.15.22 PM.png

    But I would like to display the month number next to the month name like: '1-January', '2-February', '3-March',.....

    How could I do that???

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

    Default

    Hi--

    Out of the box, there's no way to do this via config. The createSlots method in Ext.picker.Date uses Ext.Date.monthNames to populate the slot values. You could extend/override this and provide your own values if you'd like:

    https://fiddle.sencha.com/#fiddle/t2f

    Thanks
    Joel

Similar Threads

  1. Datepickerfield
    By lipepe in forum Sencha Touch 2.x: Q&A
    Replies: 2
    Last Post: 9 Jul 2012, 4:14 AM
  2. [FIXED] How to blank out a DatePickerField
    By justinKohactive in forum Sencha Touch 2.x: Bugs
    Replies: 9
    Last Post: 12 Feb 2012, 7:45 PM
  3. Problem with datepickerfield
    By undefiniert2 in forum Sencha Touch 1.x: Q&A
    Replies: 1
    Last Post: 17 Nov 2011, 11:56 AM
  4. datepickerfield bug?
    By nofx in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 5 Oct 2011, 5:32 AM
  5. Esc button in DatePickerField
    By PSB in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 16 Oct 2010, 2:55 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
  •