Skip to content

Commit

Permalink
Fix metadata expire time
Browse files Browse the repository at this point in the history
Obtain the unix timestamp in Number before the sum.

Signed-off-by: Jorge Marques <[email protected]>
  • Loading branch information
gastmaier committed Oct 25, 2024
1 parent 4a2e63c commit 3156a79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adi_doctools/theme/cosmic/scripts/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ class Navigation {
json = JSON.parse(json)

let unix_day = new Date(0)
unix_day.setHours(24)
if (json === null || json['timestamp'] + unix_day < Date.now()) {
unix_day.setHours(3)
if (json === null || json['timestamp'] + unix_day.valueOf() < Date.now()) {
let metadata = `${this.globalRoot}doctools/metadata.json`

fetch(metadata, {
Expand Down

0 comments on commit 3156a79

Please sign in to comment.