-
3 May 2012 10:15 PM #1
Answered: Load DateTime from .net
Answered: Load DateTime from .net
Hi guys, I have a question, I have a list of DateTime, like this:
When I try to save into my model doesn't work:Code:"FechaValidez":"\/Date(1336069663628)\/","FechaValidezString":"04/05/2012"
7d01d284e341441f9b20335.pngCode:{ name: 'FechaValidez', type: 'date', dateFormat: 'c' },
What I have to do?
Thanks in advance.
-
Best Answer Posted by AkashSaikia
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
Links related to thesePHP 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({id: 123, name: 'Abe Elias',height: 76 }); 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) });
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.
-
4 May 2012 1:41 AM #2
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.
-
7 May 2012 7:00 AM #3
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?
-
14 May 2012 9:31 AM #4
-
14 May 2012 9:35 AM #5
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...
-
14 May 2012 9:44 AM #6
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:
And I have to set "Fecha" into a variable of my model:Code:{ "objPedido": {"Fecha":"\/Date(1334034000000)\/","FechaString":"10/04/2012"}}
But I get:Code:{ name: 'Fecha', type: 'date', dateFormat: 'c' }, { name: 'FechaString', type: 'string'}
What do I have to do to set the right type of datetime into my model?Code:Fecha: null FechaString:"10/04/2012"
Thanks for the reply.
-
14 May 2012 10:21 AM #7
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
Links related to thesePHP 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({id: 123, name: 'Abe Elias',height: 76 }); 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) });
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.
-
14 May 2012 12:19 PM #8
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.
Thanks for everything.Code:{ "objPedido": {"Fecha":"2012-05-14T15:21:55.6695341-05:00","FechaString":"10/04/2012"}}
-
14 May 2012 8:34 PM #9


Reply With Quote
