1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Answers
    4
    Vote Rating
    0
    izak18 is on a distinguished road

      0  

    Default Answered: Load DateTime from .net

    Answered: Load DateTime from .net


    Hi guys, I have a question, I have a list of DateTime, like this:

    Code:
    "FechaValidez":"\/Date(1336069663628)\/","FechaValidezString":"04/05/2012"
    When I try to save into my model doesn't work:

    Code:
    { name: 'FechaValidez', type: 'date', dateFormat: 'c' },
    7d01d284e341441f9b20335.png

    What I have to do?
    Thanks in advance.

  2. See as per my knowledge it does not have something as Date type,

    And the other thing is that the data coming is not a Date type, it is a simple string 'Date(545311)'

    Follow up this example
    PHP Code:
    Ext.regModel('User', {          fields: [{name'id'type'int'},            'name',            { name'height',  type'int',                 convert: function(inches) {                        return Math.round(inches 2.54);                            }          }]  var abe = new User({id123name'Abe Elias',height76 });   console.log(abe.get('id')); //logs 123 (a JavaScript Number object) console.log(abe.get('name')); //logs 'Abe Elias' (A JavaScript String object) console.log(abe.get('height')); //logs 193 (inches converted to centimeters) }); 
    Links related to these
    http://pastebin.com/D5epenCM
    http://stackoverflow.com/questions/7...ith-date-field
    http://www.sencha.com/blog/ext-js-4-anatomy-of-a-model

    I hope this helps.

  3. #2
    Sencha User AkashSaikia's Avatar
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    33
    Answers
    1
    Vote Rating
    0
    AkashSaikia is on a distinguished road

      0  

    Default


    May be beacause, it does not directly execute the expression in the way you have implemented.

    I think there is a option/way out where you can define some functions that will manipulated in the data that is coming.

  4. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Answers
    4
    Vote Rating
    0
    izak18 is on a distinguished road

      0  

    Default


    Thanks for the answer AkashSaikia, I think so too, I saw cases but none of them can help me, I can't find a solution to my problem ... anybody can help me please?

  5. #4
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Answers
    4
    Vote Rating
    0
    izak18 is on a distinguished road

      0  

    Default


    Any ideas?

  6. #5
    Sencha User AkashSaikia's Avatar
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    33
    Answers
    1
    Vote Rating
    0
    AkashSaikia is on a distinguished road

      0  

    Default


    Are you still stuck in the same problem ?

    And what is the title all about? it is related to .net?

    What is that?

    Specify it all again...

  7. #6
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Answers
    4
    Vote Rating
    0
    izak18 is on a distinguished road

      0  

    Default


    Yeah, I'm still here, I was seeing other stuff about sencha and now I have to see this again. .

    The problem is still the same, I have a list of items that .net give me back, something like this:

    Code:
    { "objPedido": {"Fecha":"\/Date(1334034000000)\/","FechaString":"10/04/2012"}}
    And I have to set "Fecha" into a variable of my model:

    Code:
    { name: 'Fecha', type: 'date', dateFormat: 'c' },
    { name: 'FechaString', type: 'string'}
    But I get:

    Code:
    Fecha: null
    FechaString:"10/04/2012"
    What do I have to do to set the right type of datetime into my model?
    Thanks for the reply.

  8. #7
    Sencha User AkashSaikia's Avatar
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    33
    Answers
    1
    Vote Rating
    0
    AkashSaikia is on a distinguished road

      0  

    Default


    See as per my knowledge it does not have something as Date type,

    And the other thing is that the data coming is not a Date type, it is a simple string 'Date(545311)'

    Follow up this example
    PHP Code:
    Ext.regModel('User', {          fields: [{name'id'type'int'},            'name',            { name'height',  type'int',                 convert: function(inches) {                        return Math.round(inches 2.54);                            }          }]  var abe = new User({id123name'Abe Elias',height76 });   console.log(abe.get('id')); //logs 123 (a JavaScript Number object) console.log(abe.get('name')); //logs 'Abe Elias' (A JavaScript String object) console.log(abe.get('height')); //logs 193 (inches converted to centimeters) }); 
    Links related to these
    http://pastebin.com/D5epenCM
    http://stackoverflow.com/questions/7...ith-date-field
    http://www.sencha.com/blog/ext-js-4-anatomy-of-a-model

    I hope this helps.

  9. #8
    Sencha User
    Join Date
    Mar 2012
    Posts
    104
    Answers
    4
    Vote Rating
    0
    izak18 is on a distinguished road

      0  

    Default


    You're right, the data that I had are not a valid format datetime, I changed my json library in my .net application and now I get a correct format.

    Code:
    { "objPedido": {"Fecha":"2012-05-14T15:21:55.6695341-05:00","FechaString":"10/04/2012"}}
    Thanks for everything.

  10. #9
    Sencha User AkashSaikia's Avatar
    Join Date
    Oct 2011
    Location
    Mumbai, India
    Posts
    33
    Answers
    1
    Vote Rating
    0
    AkashSaikia is on a distinguished road

      0  

    Default



Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi