Results 1 to 4 of 4

Thread: Date serialization format

  1. #1

    Join Date
    Aug 2013
    Location
    Paris
    Posts
    2
    Vote Rating
    0
      0  

    Default Date serialization format

    In a form, we use the ExtDatePickerField component to select a date.

    The form submit triggers a REST request to refresh a datagrid. The grid has a dataStore, and uses a Ext.data.proxy.Ajax with the following config:

    Code:
     const proxy = new Ext.data.proxy.Ajax({
      url: props.url,
      groupParam: "groupBy",
      paramsAsJson: true,
      actionMethods: {
        create: 'POST',
        read: 'POST',
        update: 'POST',
        destroy: 'POST'
       },
      headers: {
        'Accept': 'application/json'
      },
      reader: {
        type: 'json',
        rootProperty: 'results',
        keepRawData: true
      },
      writer: {
        type: 'json',
        dateFormat: 'C'
      }
    })
    In this configuration, writer dateFormat appears to be ignored. ExtDatePickerField date is always serialized with a default format that cannot be parsed by the backend server.

    How can we configure a global date serialization format?

  2. #2
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,518
    Answers
    159
    Vote Rating
    79
      0  

    Default

    What does your model look like?
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

  3. #3

    Join Date
    Aug 2013
    Location
    Paris
    Posts
    2
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by tristan.lee View Post
    What does your model look like?
    The form we are submitting is a filter form (in a page containing filters and a datagrid).
    This form is not a domain object, and form fields does not match the datagrid columns. So we don't have an associated model for this form.

  4. #4
    Sencha - Sustaining Engineer tristan.lee's Avatar
    Join Date
    Mar 2015
    Location
    Central Ohio
    Posts
    1,518
    Answers
    159
    Vote Rating
    79
      0  

    Default

    Well, this config is validated against the model for fields of type date so if it's not validated against a model, there's nothing to covert.

    A code sample would be helpful on how the grid, form, and data is setup to better help understand what is going on.
    Tristan Lee
    Sencha Inc - Sustaining Engineer


    Having an issue? Help us help you - be detailed; provide some code; demonstrate with a fiddle (fiddle.sencha.com)

    Embed your fiddle in your post: [FIDDLE]id[/FIDDLE]

Similar Threads

  1. Replies: 4
    Last Post: 20 Jun 2017, 4:28 AM
  2. Ext.date.format unable to format yang:date-time
    By vikramjit.singh in forum Ext 6: Q&A
    Replies: 2
    Last Post: 20 Oct 2016, 6:07 AM
  3. Replies: 2
    Last Post: 18 Jun 2016, 9:27 PM
  4. Controlling Time Zone and Date Format for date field - specifically date picker.
    By erez.harari@sungard.com in forum Ext GWT: Help & Discussion (1.x)
    Replies: 0
    Last Post: 22 Apr 2013, 11:41 PM
  5. JSON serialization of Date should be in UTC
    By mikaelstaldal in forum Ext 3.x: Bugs
    Replies: 0
    Last Post: 25 Jan 2011, 2:54 AM

Posting Permissions

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