Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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>

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    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.


  •  

    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
    •