Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript getting rid of the time stamp on my twitter feed

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #29031
    kloy
    Member

    I just added a twitter feed to my site.
    Though it has a time stamp on it that i would like to get rid of.
    I don’t know enough about JS to know how to alter this code.
    It looks like this is the section that needs the change. I tried taking the whole section out and it the entire feed disappears.
    Here is my site
    http://www.palettedesign.com

    I got the code from–
    http://tweet.seaofclouds.com/

    Any help is appreciated. Thanks!!

    Code:
    function relative_time(time_value) {
    var parsed_date = parse_date(time_value);
    var relative_to = (arguments.length > 1) ? arguments[1] : new Date();
    var delta = parseInt((relative_to.getTime() – parsed_date) / 1000);
    var pluralize = function (singular, n) {
    return ” + n + ‘ ‘ + singular + (n == 1 ? ” : ‘s’);
    };
    if(delta < 60) { return 'less than a minute ago'; } else if(delta < (60*60)) { return 'about ' + pluralize("minute", parseInt(delta / 60)) + ' ago'; } else if(delta < (24*60*60)) { return 'about ' + pluralize("hour", parseInt(delta / 3600)) + ' ago'; } else { return 'about ' + pluralize("day", parseInt(delta / 86400)) + ' ago'; } }
    #76664
    david_v
    Member

    Hi Kloy,

    You have two options:

    1. Set the anchor tag to display none.

    Code:
    .tweet_time a { display: none; }

    2. Modify the JS file to provide an option to display the date.

    Line 18 & 19:
    Change this:

    Code:
    query: null // [string] optional search query
    };

    To This:

    Code:
    query: null // [string] optional search query
    date: 1 // [integer] 1 = yes, 0 = no
    };

    Line 148

    Change this:

    Code:

    To This:

    Code:
    var date_template = ‘‘+relative_time(item.created_at)+’‘;

    var date = (s.date ? date_template : ”);

    Finally, add the date option to your HTML page:

    Code:

    Best regards,

    David

    #76695
    kloy
    Member

    Thanks David!!
    Option one did the trick!!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.