Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha Premium Member intellix's Avatar
    Join Date
    Mar 2012
    Location
    UK + Malta
    Posts
    263
    Vote Rating
    18
    intellix will become famous soon enough

      0  

    Default Ext.picker.Date to default to current date and yearFrom, yearTo to be dynamic

    Ext.picker.Date to default to current date and yearFrom, yearTo to be dynamic


    Hey, I'm trying to create a Date of Birth Ext.picker.Date instance in Architect and I'm not entirely sure that it's possible to make it be a little clever (inside of Architect).

    In this documentation: http://docs.sencha.com/touch/2-0/#!/api/Ext.picker.Date

    It says that you can populate the current date using
    Code:
    new Date()
    but I'm not able to replicate this inside of Architect.

    To register on the mobile application I'm using you need to be 18, so I would also like to dynamically create the yearTo value so that it's exactly 18 years ago.
    Something like this in psuedo:

    Code:
    var d = new Date(),
        lastPossibleYear = d.getFullYear() - 18;
    
    picker: {
        yearTo: lastPossibleYear
    }
    I'm thinking at the moment I'm going to have to edit the picker upon creation of the form, right?
    Edit: Not even sure how to do the above ;D Ext.navigation.View containing multiple Ext.form.Panel with the first panel linked inside the Ext.navigation.View. It doesn't seem to fire any sortof initialise, painted, show event upon starting with it as my initalView. How am I meant to be listening to this Form Panel being displayed so I can change the datePicker?

    Thanks, Dom

  2. #2
    Sencha User
    Join Date
    Jun 2011
    Location
    Sydney, Australia
    Posts
    23
    Vote Rating
    0
    thetallbloke is on a distinguished road

      0  

    Default


    Hi Dom,

    Did you get this sorted out... I'm trying to do the same thing at the moment...

    I tried doing it in code, which "works", but it also has the effect of displaying the picker..

    I've been using the code:
    medicareExpiryField.getPicker().setYearTo(new Date().getFullYear() + 8);

    I'm now looking for a better way so that I don't have it display the picker..

  3. #3
    Sencha Premium Member intellix's Avatar
    Join Date
    Mar 2012
    Location
    UK + Malta
    Posts
    263
    Vote Rating
    18
    intellix will become famous soon enough

      0  

    Default


    I'm doing it exactly as you are, upon init I'm getting the current date and setting it to that :P

  4. #4
    Sencha Premium Member intellix's Avatar
    Join Date
    Mar 2012
    Location
    UK + Malta
    Posts
    263
    Vote Rating
    18
    intellix will become famous soon enough

      0  

    Default


    Just for anyone coming in after the latest version. I believe it's now possible to just specify the date as new Date()

    Edit: My bad... right now you can only set an object for DatePicker but not the Picker -.-

    So this is the solution I was using before anyway:

    Code:
    onInit: function (component, options) {
        var currentTime = new Date();
    
        component.setValue({
            year: currentTime.getFullYear() - 18,
            // Month is 0-11 in JS so do a +1
            month: (currentTime.getMonth() + 1),
            day: currentTime.getDate()
        });
    
    
        component.setYearTo(currentTime.getFullYear() - 18);
    }

  5. #5
    Sencha Premium Member intellix's Avatar
    Join Date
    Mar 2012
    Location
    UK + Malta
    Posts
    263
    Vote Rating
    18
    intellix will become famous soon enough

      0  

    Default


    Can I just bump this for the devs?

    You added the ability to specify 'value' as a Date or Object on Ext.picker.Date but not Ext.picker.Picker

    So with the above I'm still having to use the above 'init' method to set the default value to 18 years ago upon tapping it.

    I'm guessing this is a really easy fix to just enable that particular property to allow it.

Thread Participants: 1

Tags for this Thread