1. #1
    Sencha Premium Member
    Join Date
    Mar 2013
    Posts
    27
    Answers
    4
    Vote Rating
    0
    BKrones is on a distinguished road

      0  

    Default Unanswered: Datetime Picker with a different timezone

    Unanswered: Datetime Picker with a different timezone


    Hi there,
    i got a simple task-list app.
    Each task has a target date (e.g. 2014-04-28T00:00:00 ).
    In my form i got a date picker as well as buttons to in-/decrement the date-value of the picker itself.
    (A button to add "day +1, day -1, minute +1, minute -1", etc. )

    My Model:
    Code:
    {
       dateFormat: 'c',
       name: 'TargetDate',
       type: 'date'
    }
    The date-time-picker:
    Code:
    {                                
       xtype: 'datepickerfield',
       itemId: 'targetDateField',
       label: 'Zieldatum:',
       name: 'TargetDate',
       required: true,
       placeHolder: '01.01.1990 00:00',
       dateFormat: 'd.m.Y H:i',
       picker: {
          dayText: 'Tag',
          monthText: 'Monat',
          slotOrder: [
             'day',
             'month',
             'year'
          ],
          yearFrom: 2014,
          yearText: 'Jahr',
          yearTo: 2040
       }
    }
    For instance, i use this function for "minute +1"-button:
    Code:
    addMinutes: function(button, e, eOpts){
       console.log('Before Add: ' + this.getTargetDatePicker().getValue());
    
       this.getTargetDatePicker().setValue(
          Ext.Date.add(this.getTargetDatePicker().getValue(), Ext.Date.MINUTE, 1)
       );
    
       console.log('After Add: ' + this.getTargetDatePicker().getValue());
    }
    My log returns correct values of the date-picker every time i press the button:
    Code:
    Before Add: Mon Apr 28 2014 00:00:00 GMT+0200 (W. Europe Daylight Time)
    After Add: Mon Apr 28 2014 00:01:00 GMT+0200 (W. Europe Daylight Time)
    Before Add: Mon Apr 28 2014 00:01:00 GMT+0200 (W. Europe Daylight Time)
    After Add: Mon Apr 28 2014 00:02:00 GMT+0200 (W. Europe Daylight Time)
    Before Add: Mon Apr 28 2014 00:02:00 GMT+0200 (W. Europe Daylight Time)
    After Add: Mon Apr 28 2014 00:03:00 GMT+0200 (W. Europe Daylight Time)
    ...
    But after using the date-picker itself, picking any value, my other buttons just add their value once to the date-picker-field and stop adding more (the console doesn't even at this value once:

    New log:
    Code:
    Before Add: Wed May 28 2014 00:00:00 GMT+0200 (W. Europe Daylight Time)
    After Add: Wed May 28 2014 00:00:00 GMT+0200 (W. Europe Daylight Time)
    Before Add: Wed May 28 2014 00:00:00 GMT+0200 (W. Europe Daylight Time)
    After Add: Wed May 28 2014 00:00:00 GMT+0200 (W. Europe Daylight Time)
    Neither the date-picker-value nor the log-value change anymore. Why is that and how can i fix this?


    Best Regards

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    2,860
    Answers
    220
    Vote Rating
    89
    fmoseley is just really nice fmoseley is just really nice fmoseley is just really nice fmoseley is just really nice fmoseley is just really nice

      0  

    Default


    Hard to tell from the info you have provided. What debugging have you done far?
    Have you set a breakpoint in your addMinutes function and stepped through it to see what is going on?
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

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

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

    Need to include a test case use:
    The official Sencha Fiddle

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar