Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-07-2010, 05:59 AM   PM User | #1
Nicklarzn
New to the CF scene

 
Join Date: Dec 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Nicklarzn is an unknown quantity at this point
Exclamation Sorting of RSS data

Hello everyone
I'm quite new at this coding-thing and hope that you can help me out.

On my website www.visitmariagerfjord.dk i have put a RSS feed, wich shows the upcoming events in my munincipality. But they are not sorted properly...

The articles shown in the RSS are events. The event-date is written in the title and in order for me to sort them by the event-date i sort them by the title in the code.

BUT this makes it sort the articles by only the first letter in the title
sthat it i.e. looks like this:

11. december: event 1
2. december: event 2
4-5. december: event 3

what have i done wrong? here is the code i used:

Code:
<head>
<meta http-equiv="Content-Language" content="da">
<style type="text/css">
.style1 {font-family: Verdana; font-size: xx-small; }
a { color: #CC0034; } 
a:active { color: #CC0034; } 
a:hover { color: #CC0034; } .
style2 { line-height: 150%; }
</style>
</head>
<table style="width: 211px" cellspacing="0" cellpadding="0">
<tr>
<td class="style1">
<p class="style2"><head></head>
<SCRIPT type=text/javascript src="http://www.google.com/jsapi/?key=ABQIAAAA9eRU-vAdivYIHMi8NypOyhR6VdgIuGtsbVFT62Qxi5tkD2_rtRTAXgOh9iGox0fIywO62d3SLZxAhA"></SCRIPT>
<SCRIPT type=text/javascript src="gfeedfetcher.js"></SCRIPT>
<body style="background-color: #EAEDE4">
<SCRIPT type=text/javascript>
var socialfeed=new gfeedfetcher("example2", "example2class", "_new")
socialfeed.addFeed("Kommende arrangementer", "http://www.visitmariagerfjord.dk/danmark/da-dk/menu/turist/det_sker/arrangementer2010/rss.htm?WBCMODE=PresentationUnpublished&rss=true")
socialfeed.setentrycontainer("div")
socialfeed.filterfeed(4, "title")
socialfeed.init()
</SCRIPT>
</p>
</td>
</tr>
</table>
Nicklarzn is offline   Reply With Quote
Old 12-07-2010, 10:47 AM   PM User | #2
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
The date is being stored as a string. Sorting a string will do so alphabetically. To sort by date you need your dates to be in a valid date format, which won't be easy as some of the dates seem to date ranges.
Spudhead is offline   Reply With Quote
Reply

Bookmarks

Tags
events, gfeedfetcher, rss, socialfeed, sorting

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:55 AM.


Advertisement
Log in to turn off these ads.