Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Row Editor sending wrong Date

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Location
    India
    Posts
    180
    Answers
    1
    Vote Rating
    -7
      0  

    Default Row Editor sending wrong Date

    Hi
    Recently I have upgrade my Ext version from 4.0.7 to 4.1.1

    In my model I have defined like
    Code:
     {name : 'StartDate',type: 'date' ,dateFormat: 'time'},
    My Grid Column is

    Code:
    {
    	id: 'StartDateID',
    	width: 180,
    	text: 'Start Date',
    	dataIndex: 'StartDate',
    	renderer : Ext.util.Format.dateRenderer('m/d/Y'),
    	editor:{
    		allowBlank: true,
    		xtype:'datefield',
    		format:'m/d/Y',
    		editable: true},
    	sortable: false, groupable: false }
    On Edit I am doing
    Code:
    My_Grid.on('edit', function(editor, e) {
    e.store.sync();
    }
    After clicking on Update I used to get [with Ext 4.0.7 ] date value as
    Code:
    2012-08-04T00:00:00
    but after upgrade with 4.1.1 I am getting date value as

    Code:
    310008e
    Which I am not understanding.

    Can you please suggest me what is missing here? Or else how to get proper date after clicking update button from RowEditor.

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,407
    Answers
    716
    Vote Rating
    503
      0  

    Default

    Can you try updating your dateFormat to the format you want ... instead of 'time'

    Scott.

  3. #3
    Sencha User
    Join Date
    Aug 2011
    Location
    India
    Posts
    180
    Answers
    1
    Vote Rating
    -7
      0  

    Default

    Hi ,
    Thanks for the reply.

    The date which I am getting from server side is in timeStamp.
    Code:
    1346351400000
    SO i have used the dateFormat as "time"

    Can you please suggest what can be done ? to get the proper date at server side.

    Please suggest code changes as well. so that I will get date, in readable format.

  4. #4
    Sencha User
    Join Date
    Aug 2011
    Location
    India
    Posts
    180
    Answers
    1
    Vote Rating
    -7
      0  

    Default

    Can you please suggest me ?

  5. #5
    Sencha User friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
      0  

    Default

    Visit the Ext.Date API documentation for a complete list of date/time formats.

  6. #6
    Sencha User
    Join Date
    Aug 2011
    Location
    India
    Posts
    180
    Answers
    1
    Vote Rating
    -7
      0  

    Default

    I have tried changing the dataformat to my expected format but still I am getting the same date i.e

    Code:
    310008e
    Also as per suggestion , if I change the dateFormat from the Modal to say "timestamp" Then I get date as "310008e0031am08p" But If I change the dateFormat to say "d/m/y" , then I get proper date, but I am not able to show the date in grid, as show in the below image with Red square.


    Please suggest me the format which will return proper date, also in grid I can see it in "d/m/y" format. as shown in attached image.

    e.jpg

  7. #7
    Sencha User
    Join Date
    Aug 2011
    Location
    India
    Posts
    180
    Answers
    1
    Vote Rating
    -7
      0  

    Default

    Plz suggest me.

  8. #8
    Ext JS Premium Member
    Join Date
    Mar 2008
    Posts
    7
    Answers
    4
    Vote Rating
    1
      0  

    Default

    Look for submitFormat property or you can override the getSubmitValue().

    Cheers,

  9. #9
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,407
    Answers
    716
    Vote Rating
    503
      0  

    Default

    Did the post on SO solve your problem?
    {name : 'StartDate',type: 'date' ,dateFormat: 'U'},

    http://stackoverflow.com/questions/1...ing-wrong-date

    Scott.

  10. #10
    Sencha User
    Join Date
    Aug 2011
    Location
    India
    Posts
    180
    Answers
    1
    Vote Rating
    -7
      0  

    Default

    No,
    There also I have mentioned that same that,
    I can see the return value in proper format, as I have mentioned in the Model. but when I gave the dateFormat at "u" , OR anything else, I am not able to see the date in Grid.
    So please suggest me.

Page 1 of 2 12 LastLast

Posting Permissions

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