Results 1 to 3 of 3

Thread: How to convert date format from "dd/mm/yyyy" to "d/m/Y" (ExtJs format)

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    11
    Vote Rating
    0
      0  

    Default How to convert date format from "dd/mm/yyyy" to "d/m/Y" (ExtJs format)

    Hi All,

    I am trying to create a ExtJs "datefield" using user's input, all are well and good, except the format given by the user.

    User will give the JS format string like "dd/mm/yyyy" which will reflect change of format if applied directly to "format" attribute in "datefield".

    Since "dd/mm/yyyy" will return "0606/0404/12121212" for "06/04/2012" which is "d/m/Y".

    Is there any method available in Ext, to convert the format string.

    Thanks.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You can only have one format to display but you can use altFormats config to accept different input formats that a user can type

    http://docs.sencha.com/ext-js/4-0/#!...cfg-altFormats
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Moved to Ext JS 4 Q&A forum.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Tags for this Thread

Posting Permissions

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