Results 1 to 3 of 3

Thread: datepickerfield sets year to 1901

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    44

    Default datepickerfield sets year to 1901

    I am seeing a couple issues with the following datepickerfield configuration. First, if the earliest year is selected (in this case 2012), the year is set to 1901. Also, if you select 'done' without moving the picker the date is not set.

    Code:
    {
      xtype: 'datepickerfield',
      name : 'time',
      label: 'When',
      picker: {
        yearFrom: (new Date()).getFullYear(),
        yearTo: (new Date()).getFullYear() + 2,
      }
    },

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,449

    Default

    Using this full test case:

    Code:
    new Ext.Container({
        fullscreen : true,
        items      : [
            {
                xtype  : 'datepickerfield',
                name   : 'time',
                label  : 'When',
                picker : {
                    yearFrom : new Date().getFullYear(),
                    yearTo   : new Date().getFullYear() + 2
                }
            }
        ]
    });
    I don't see 1901. The year slot shows 2012, 2013 and 2014 as expected.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Nov 2013
    Posts
    1

    Default

    i am using datepickerfield field in my project

    xtype: 'datepickerfield',
    picker: {
    slotOrder: ['month', 'day', 'year'],
    yearFrom: new Date().getFullYear() - 18,
    yearTo: new Date().getFullYear() - 70,
    // doneButtonText:'Next'
    },
    but sometimes in server logs we can see the date as 1901
    after getting the date object we sent to server using ajax call

    what can be the issue??




Posting Permissions

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