-# Author: Connor Beardsmore <connor DOT beardsmore AT gmail DOT com>
-# Last Modified: 21/06/16
+# Author: Connor Beardsmore <connor.beardsmore@gmail.com>
+# Last Modified: 23/06/16
 
 # Bash command to pull events from icalBuddy
 # Set +2 to how many days you want to show
 # icalBuddy has more functionality that can be used here
-command: "/usr/local/bin/icalBuddy eventsToday+2"
+command: "/usr/local/bin/icalBuddy -n eventsToday+2"
 
 # Update is called once per hour
 refreshFrequency: "1h"

        padding-bottom 3px
"""

# Initial render
render: (output) -> """
    <div id="head"> Upcoming Events </div>
"""

            # Tokenize icalBuddy output string
            name_and_calendar = newarray[i].split('(')
            name = name_and_calendar[0].substr(1)
            # Trim length of name field
            if ( name.length > 25 )
                name = name.substr(0,25) + "..."
            # Trim date and format output
            if ( ':' in newarray[i+1] )
                date = ((newarray[i+1].split("at"))[1])
                date = "at" + date.substr(0,9)
            # If its an allday event, date field is empty
            else
                date = ""
            # Cleanse output from icalBuddy
            calendar = name_and_calendar[1].replace(')','')
            # Combine all fields
            final = calendar + " - " + name + date

            # Add this HTML to previous, only if it doesn't already exist
            if ($(domEl).text().indexOf(final) == -1)
                $(domEl).append("""
                <div>
                    #{final}
                </div>
                """)
