up.fragment up.fragment.time(element)
JavaScript function

Returns the last modification time of the content in the given element.

The last modification time corresponds to the Last-Modified header in the response that rendered the fragment. Alternatively the [up-time] attribute of the element or an ancestor is used.

If no ancestor fragment with an [up-time] attribute exists, undefined is returned.

When the fragment is reloaded, its modification time is sent as an If-Modified-Since request header. The server may check the header and decide to skip rendering.


Parameters

element
required
Type: Element

Return value

The fragment's last modification time.

Returns undefined if the fragment was rendered without a modification time.

Type: Date | undefined