[CLOSED] ModelField DateFormat problem

  1. #1

    [CLOSED] ModelField DateFormat problem


    I am trying to develop an rss feed viewer loosely based on your "Feed Viewer" combination sample.

    I have a problem with a Date type ModelField, which cannot be parsed correctly and is undefined on the client side:

    <ext:ModelField Name="pubDate" Type="Date" DateFormat="ddd, dd MMM yyyy HH:mm:ss 'GMT'" />
    I have tried .net's DateTime.ParseExact on the server side and it correctly parses the string from my xml file with the provided DateFormat.
    Removing the type and dateformat from the modelfield causes the string to be correctly displayed in my grid.

    I will provide no code sample, as your Feed Viewer suffers from the same problem (data column in FeedGrid is not populated with data, see 2.1 examples).

    Any help will be appreciated
    Last edited by Daniil; Mar 05, 2013 at 4:04 AM. Reason: Please yse [CODE] tags, [CLOSED]
  2. #2
    FeedViewer example expects the following format
    DateFormat="ddd, dd MMM yyyy HH:mm:ss O"
    therefore it correctly parse dates of third feed (Ajaxian)
    Fri, 02 Nov 2012 01:59:37 +0000
    First and two feeds use the following format (GMT at the end)
    Thu, 28 Feb 2013 12:06:49 GMT
    Therefore such date is not parsed (ModelField can use only one format)

    Please post date which should be parsed by model field in your application
  3. #3
    Hi Vladimir,

    the date format is according to the RSS recommendation: "Thu, 05 Apr 2012 14:53:48 GMT" with the GMT at the end. that is why i tried using DateFormat="ddd, dd MMM yyyy HH:mm:ss 'GMT'".

    The thread culture that is currently set is "de-CH", which might be one reason why it is failing, although i tried modifying the feed to change the english abbreviations to german ones and it was still not working propertly.
  4. #4
    Try this
    ddd, dd MMM yyyy HH:mm:ss \G\M\T
    or this
    ddd, dd MMM yyyy HH:mm:ss T
    Also please ensure that locale file is not rendered by ResourceManager (or ensure that rendered locale is correct for you) because ExtJS uses localized week/month names for date parsing
    For example, if set Russian locale (locale set automatically depend from server locale) then 'Thu' will not be parsed correctly because it is not russian week name
  5. #5
    Hi Vladimir,

    I tried both but none of them did it. Where shall i look for the date parsing code (filename in src)?
    Anyways, for the moment i will process the rss feed with the SyndicationItem class from microsoft and bind these to my grid.
    Can i somehow bind the syndication items directly?

  6. #6
    Can you post here generated html (with generated) script? Just open the page in the browser and choose View Source
    Please simplify the page before (only grid to display RSS feeds)

    As I said before that if you use German locale then date should contain German week/month names because parsing is localized

    Can i somehow bind the syndication items directly?
    I don't know, I am not familar with SyndicationItem
    Last edited by Daniil; Mar 05, 2013 at 4:08 AM.

Similar Threads

  1. ext:ModelField Mapping attribute not working
    By jbarbeau in forum 2.x Help
    Replies: 5
    Last Post: Jan 14, 2013, 10:01 AM
  2. Replies: 3
    Last Post: Jul 17, 2012, 1:44 PM
  3. [CLOSED] RecordField vs ModelField and Reconfigure vs Render
    By Sevilay Tanış in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 13, 2012, 3:20 PM
  4. Replies: 2
    Last Post: Jul 08, 2009, 12:37 PM
  5. DateFormat in Grid Problem
    By bruce in forum 1.x Help
    Replies: 1
    Last Post: Mar 19, 2009, 8:47 AM

Tags for this Thread

Posting Permissions