JS for DIV to display if published after a certain date - javascript

There are some vintage answers but they seem to be based on the client date.
I simply need a DIV to display if the posted (published) date of the article is on or after 2/25/2017. Platform=Google Blogger so no PHP.
Thanks

Related

How can I prevent a search & filter script from using image urls in the result?

I have a table on one of my webpages that can be filtered using a search bar.
The script works pretty much as intended but for one problem.
Each row of the table contains an image of a flag. All of these images were uploaded to my site in 2018. This means if a user searches for 2018 the table remains unfiltered because the script is using the 2018 from the image src url in the results.
Is it possible for me to have the script ignore those image urls?
If you search for 2018 in the search bar on WEBSITE REMOVED you'll see my issue. Search for others years and you'll see that it works fine.
The script I'm using is:
SCRIPT REMOVED
I would appreciate any help on this.
If you look at the textContent of the table cell, you'll see it includes the URL.
Your solution is just to be more specific about you want. Maybe
rows[0].cells[2].getElementsByTagName("a")[0].textContent

How do I sort a <ul> list by datetime?

I have a <ul> list which is generated using javascript when the page loads (by appending a var with <li> tags to a <ul> element).
How can I make it so the <li> with the NEWEST date is at the top when the page loads?
Also, my code is extremely long (~6000 words) and include outside sources (to google's api), but I understand how I can implement this into my code. Here's some pseudo-code to explain how I get stuff generated into the js/html:
I have a <ul> element with nothing inside the tags
I get information about a user's last 5 uploaded videos from youtube using google's API, this information includes channel name, video title, video ID, thumbnail URL, and the date and time the video was published at (a string with the ISO 8601 format).
Next this information is used to make a var (which includes html tags and styles) for example:
var output = '<li><p>'+VideoTitle+'</p><p>'+publishedAt+'</p>\
<img src="'+videoThumbnail+'" height="90px"></li>'
This code is added via 2 functions. 1 gets the information from localStorage using a function called "addUsers()" which is essentially just a for loop which grabs the key from localstorage and uses it as a var and parses it through a parameter to the function which adds it to the < ul > list. and 2 it gets information from an text field input (upon clicking a button as well) activates the function "addUserLocalStorage()" which adds the username to the localStorage, and also displays the youtube videos on screen as well; on refresh it gets the information from the addUsers() function.
So obviously it'd be super easy to just add the publishedAt var anywhere I wanted in the element without much hassle. but it's more about how I will implement it and use it to help sort the unordered list and make it ordered.
Any suggestions welcome as usual :)
I found a plugin called TinySort which seems to do exactly what I'm looking for. If I just convert my date string to a unix timecode it'll work just by sorting them from lowest number to highest.
Since you are using jQuery maybe this will help? Which credits Bill Richards for this blog post.
EDIT: Also, you might want to consider using a data attribute to sort by - in unix time. That's easier and faster to sort by than having to parse text.
You can not sort data on (unorderd list) you need to use javascript or jquery to order data every time the page loads then put sorted data in element.

Dynamic Website Update Script

I have a website with various applets/widgets/RSS feeds. How would I go about creating a cron/script that is able to figure out when the last time one of these applets/RSS feeds was updated and store that in a database?
I'd need to be able to differentiate between an update in one feed or another. Some widgets have only pictures, one of them is the twitter widget so the content is all different.
You could find a element which has a date for example enter link description here has a pubDate element <pubDate>Mon, 28 Jul 2014 14:03:00 -0400</pubDate> or you could have a database row which told you the last article parsed from an RSS feed for each source. there would be a lot of ways this is possible, it might be worth looking on github for an opensource RSS reader and see if they have solved this problem.

Songkick widget not displaying when pasted into HTML website

I am trying to get the Songkick widget to work on my website but for some reason it doesn't seem to be pulling through the JS form correct and instead is just displaying the Title of the form.
Any ideas?
address is www.ekkoes.com/live
Thanks
Jon
You forgot the " at the end of the id of center-column.
You also have to correct your widget code to
2014 Tour Dates

How to get posting time of post in Blogger

is there any way to get the a post's date and time on which it was posted in Blogger using JAVA Script or jQuery?
The solution is just simple, do the following:
Go to your Blog's Settings>>Language and formatting
Look at the Timestamp Format, maybe that is set to only the time and does not include days and month.
Click the drop-down and change it accordingly (just copy mine above)
Solved! It's just that easy.
Go to this blog post for details...

Categories

Resources