1. #1
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
    hascl@egeli is on a distinguished road

      0  

    Default How to set the tooltip of datepicker cells of a datefield

    How to set the tooltip of datepicker cells of a datefield


    I have a form with a datefield. The datepicker of the datefield has a tooltip on every cell, which shows the current date in the following format: 'F d, Y'

    I need a different format: 'j. F Y'

    I spend a lot of time in searching after this... Every tooltip from datepicker has a describing property, configurable on the datefield, except of what I am looking for. What I found out is that the format is corresponding to the 'longDayFormat'-config property from datepicker. But I can not set this on datefield.

    So how can I set the tooltip of the cells of the datepicker from a form's datefield? Please help and thank's in advance!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,073
    Vote Rating
    854
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You need to configure the longDayFormat config on the picker.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2012
    Posts
    2
    Vote Rating
    0
    hascl@egeli is on a distinguished road

      0  

    Default


    I don't configure the date picker. I just configure a datefield on a form panel. But, because I don't see a different way, I tried it.

    Code:
    initComponent: function () {
            var me = this;
    
            var myDatefield = Ext.create('widget.datefield', {
                fieldLabel: 'Gültig ab',
                labelWidth: 80,
                startDay: 1, // Starttag der Woche ist Montag
                minValue: new Date()
            });
    
            var myDatepicker = myDatefield.getPicker(); //to get the datepicker of my form panels' datefield
    
            Ext.apply(myDatepicker, {
                longDayFormat: 'j. F Y' // dt. format als tooltip
            });
    
            Ext.applyIf(me, {
                items: [
                       // ... some form panel items
                       myDatefield,
                       // ... some form panel items
    I did the following: On the initComponent-method of my form panel I first create the datefield, then I use the datefields' getPicker-method and configure the longDayFormat to 'j. F Y'. While debugging I can see the right format in the longDayFormat config, BUT on the view it's still in the false format ('F d, Y'). I don't know why? Could you please help. Perhaps it's a bug? We use ExtJs 4.1.1.

    As remark:
    We use the german localization-file (ext-lang-de.js). So on datefield/-picker the format, disabledDaysText, disabledDatesText, maxText, minText, dayNames, today-btn. text etc. has changed to the desired format, but the longDayFormat (should be 'j. F Y') and the startDay (should be Monday - 1) has not. Perhaps a bug?

    Additionaly in my opinion the config-name 'longDayFormat' is not really describing, that this is config for a tooltip of the cells of the datepicker. Please add this to the docs. And it would be nice to configure the datepicker belonging to a datefield directly on the datefield.

Thread Participants: 1