EXT datefield control assignment problem,

Source: Internet
Author: User

Note: When I was working on the OA system today, I encountered a problem: I was assigning the time type value in the database to datefield (passed through gson ), the value passed by gson is in the format of on January 11 ,.

But the datefield format is Y-m-D (2012-11-11). When I thought it was a data error, I changed the datefield format to yyyy-mm-dd hh: MM: SS format. The result is still unavailable. I am a little hit with TMD,

Later I thought that the string was uploaded in the background and the date value assigned to ext was incorrect,

So I do it:

Success: function (G, H) {var E = ext. util. JSON. decode (H. response. responsetext ). data; var startdate = E ['trainingstarttime']; var trainingstarttime = new date (date. parse (startdate. replace (/-/g, "/"); Ext. getcmp ("trainingstarttime "). setvalue (trainingstarttime. format ('Y-m-d '));},

Then OK

Later I thought why ext didn't help me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.