Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
javierarce committed Oct 1, 2023
1 parent e92e70d commit a277ec1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/rss.reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,14 @@ class RSS extends HTMLElement {
render (data) {
const lastEntry = data.entries[0]

console.log('test')
const entryDate = document.createElement('span')
const ago = this.distance(Date.parse(lastEntry.published))
entryDate.textContent = ago ? ` ${ago} ago` : ''
entryDate.part = 'date'

const titleElement = this.shadow.querySelector('span');
titleElement.appendChild(entryDate)
const titleElement = this.shadow.querySelector('.is-url');
titleElement.parentNode.insertBefore(entryDate, titleElement.nextSibling)
this.classList.add('is-loaded')
}

Expand Down

0 comments on commit a277ec1

Please sign in to comment.