Results 1 to 4 of 4

Thread: Datefield setValue\getValue functions

  1. #1
    Sencha User
    Join Date
    May 2012
    Location
    Ukraine
    Posts
    23
    Answers
    2

    Default Answered: Datefield setValue\getValue functions

    Hello,
    looks like I have found some kind of bug in Ext.form.field.Date behavior in ExtJS 4.1.2. I have a datefield:
    Code:
    Ext.define('MyDateField', {
        extend: 'Ext.form.field.Date',
        alias: 'widget.myDateField',
        format: 'm/d/Y',
        maskRe: /[0-9\/: ]/,
        enforceMaxLength: true,
        maxLength: 16
    });
    When I'm trying to set value of this datefield using setValue() method, if the Date object is having some time different from 00:00:00, it makes datefield's time 00:00:00 with the same date and timezone.
    Example: if use datefield.setValue(new Date("Wed Dec 07 1960 23:00:00 GMT+0200 (FLE Standard Time)"), after that datefield.getValue() returns Wed Dec 07 1960 00:00:00 GMT+0200 (FLE Standard Time). Could you please give some solution for this problem?

    Thanks

  2. if you change your format to include time parameters as well e.g.

    Code:
    format: 'm/d/Y H:i:s',
    then it works but you will also see the time in the datefield then...

  3. #2
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,102
    Answers
    113

    Default

    if you change your format to include time parameters as well e.g.

    Code:
    format: 'm/d/Y H:i:s',
    then it works but you will also see the time in the datefield then...

  4. #3
    Sencha User
    Join Date
    May 2012
    Location
    Ukraine
    Posts
    23
    Answers
    2

    Default

    Thanks for your answer! It works.
    Is there possibility to not shown time and have correct datefield behavior?

  5. #4
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,102
    Answers
    113

    Default

    I am sorry I dont know. you may try to look in the API Docs and try with renderTpl or something to make it work like you want.

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
  •