Probable the easiest would be to locate the line as below output += '<p>' + entry.publishedDate + '</p>';
and replace it with something like this output += '<p>' + publishedDate.getDate() + ' ' + ['Jan','Feb','Mar','Apr'...][publishedDate.getMonth()] + ' ' + publishedDate.getFullYear() + '</p>'; Hope that helps. On Tue, Jun 11, 2013 at 8:55 AM, Sean Mitchell <[email protected] > wrote: > Hi > > I am using google RSS feed to pull in an xml file, this works well, > however the date is reversed. In the XML file, the date is correct > (DAY-MONTH-YEAR) but in my app the dates (Months and Days) are reversed. > Is this easy to fix? and if so, could anybody please help me? > > Any help would be greatly appreciated? > > Below is the code that i have so far: > var googleResult = []; > google.load("feeds", "1"); > function initialize() { > var feed = new google.feeds.Feed("http://www.** > vetsonline.com/annonces/rss.**php?idp=18&id_rss=103&site=14&** > page=accueil&c_texte=&c_**secteur=&c_type_transac=&c_** > type=&template=rssv2.xml<http://www.vetsonline.com/annonces/rss.php?idp=18&id_rss=103&site=14&page=accueil&c_texte=&c_secteur=&c_type_transac=&c_type=&template=rssv2.xml> > "); > > feed.setResultFormat(google.**feeds.Feed.MIXED_FORMAT); > feed.**includeHistoricalEntries(); > feed.setNumEntries(90); > feed.load(function (result) { > console.log(result); > > if (!result.error) { > googleResult = result ; > var output = '<ul data-role="listview" data-filter="true" > data-filter-placeholder="**Search for a phrase/word">'; > var container = document.getElementById("feed"**); > for (var i = 0; i < result.feed.entries.length; i++) { > var entry = result.feed.entries[i]; > var publishedDate = new Date($(this).find("**publishedDate").text()); > var day = publishedDate.getDate(); > var month = publishedDate.getMonth() + 1; > var year = publishedDate.getFullYear(); > var SMdate = month + '/' + day + '/' + year; > output += '<li>'; > output += '<a href= "#feedContent?i=' + i + '" data-transition = > "slide" >'; > //output += '<p class="ui-li-aside">' + entry.publishedDate + '</p>'; > output += '<h1>' + entry.title + '</h1>'; > output += '<p>' + entry.publishedDate + '</p>'; > //output += '<p class="ui-li-aside">' + entry.publishedDate.slice(0, 12) + > '</p>'; > var snippet = entry.contentSnippet; > //var code = entry.content.slice(-3); > var sm = entry.contentSnippet; > var code = entry.content.match(/\/VS|\/**VN|\/PM\/OT/); > //var code = entry.content.match(/VNT|VT\d\**d/); > var nCode = sm.concat(code); > //alert(code); > //output += '<p>' + entry.contentSnippet + '</p>'; > output += '<p>' + nCode + '</p>'; > output += '</a>'; > output += '</li>'; > } > output += '</ul>'; > $('#jobsFeed').html(output); > $('#jobsFeed').trigger('**create'); > > } > }); > } > google.setOnLoadCallback(**initialize); > > $(document).on("**pagebeforechange", function (e, data) { > // We only want to handle changePage() calls where the caller is > // asking us to load a page by URL > if (typeof data.toPage === "string") { > // We are being asked to load a page by URL > var u = $.mobile.path.parseUrl(data.**toPage), _re = "#feedContent"; > > if (u.hash.search(_re) !== -1) { > var i = urlParam("i", data.toPage); > $("#feedContent").remove(); > var $page = $("<div data-role='page' id='feedContent' > data-add-back-btn='true'><div data-role='header'><h1>" + > googleResult.feed.entries[i].**title + "</h1></div></div>"); > var $content = $("<div data-role='content' id='feedContent'></div>"); > $content.append(googleResult.**feed.entries[i].content); > $page.append($content); > $.mobile.pageContainer.append(**$page); > } > } > }); > > -- > -- > You received this message because you are subscribed to the Google > Groups "Google AJAX APIs" group. > To post to this group, send email to > [email protected] > To unsubscribe from this group, send email to > [email protected] > To view this message on the web, visit > > https://groups.google.com/d/msgid/google-ajax-search-api/9457f65e-12b3-48be-bd10-c524569f2ff9%40googlegroups.com?hl=en_US > For more options, visit this group at > http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "Google AJAX APIs" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- Jeremy R. Geerdes Generally Cool Guy Des Moines, IA If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church! http://www.debraheightswesleyan.org -- -- You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] To view this message on the web, visit https://groups.google.com/d/msgid/google-ajax-search-api/CAF4cwg_RucrJmC-M-rsqC%2BaWOGVOUuN0Ms0cb_wGV7Ao3Faqfg%40mail.gmail.com?hl=en_US For more options, visit this group at http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "Google AJAX APIs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
