ExtJS DataField Formatting

Source: Internet
Author: User

The value of the ExtJS Datefield is obtained after the GetValue () method is a bunch of strings, similar to the Tue Dec 00:00:00 GMT 0800, which is really not good to deposit into the database ... So to format it, the method is very simple, with the EXT

Ext.util.Format.date () method


Example:

var Gedt = Ext.util.Format.date (date control. GetValue (), ' y-m-d ');

The date format that came out was 2010-10-10.

//

Date  string/date value, [String format]  ) : String

Formats the passed date using the specified format pattern.

Parameters
    • value : string/date

      The value to format. If A string is passed, it's converted to a Date by the Javascript ' s built-in date.parse method.

    • format : String (optional)

      Any valid date format string. Defaults to Ext.Date.defaultFormat.

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.