github / relative-time-element

Web component extensions to the standard <time> element.

Home Page:https://github.github.io/relative-time-element/examples/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Formatting not working on page reload (looking for fallback)

drale2k opened this issue · comments

On an initial page load or page reload, the formatting is not working (Using Rails + Turbolinks). I used to solve this by calling updateNowElements directly but now that Rails 6 switch to webpacker, i'd like to know how to access updateNowElements after importing time-elements via

import timeElements from 'time-elements/dist/time-elements.js'

updateNowElements is not supposed to be a public API, this should be better resolved from the root cause. Do you have page that has this problem that we can investigate? and can you try window.customElements.upgrade(el)?