{"size": 661, "ext": "js", "max_stars_repo_path": "static/js/outdate.js", "max_stars_repo_name": "wayofthepie/serene", "max_stars_repo_stars_event_min_datetime": "2022-01-24T10:18:12.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-24T06:03:53.000Z", "max_issues_repo_path": "static/js/outdate.js", "max_issues_repo_name": "wayofthepie/serene", "max_issues_repo_issues_event_min_datetime": "2022-02-06T15:01:50.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-09T06:13:44.000Z", "max_forks_repo_path": "static/js/outdate.js", "max_forks_repo_name": "wayofthepie/serene", "max_forks_repo_forks_event_min_datetime": "2022-01-19T07:07:21.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-14T13:38:34.000Z"}
{"max_stars_count": 16, "max_issues_count": 4, "max_forks_count": 4, "avg_line_length": 34.7894736842, "max_line_length": 91, "alphanum_fraction": 0.7291981846}
const publish = document.querySelector('#publish');
const updated = document.querySelector('#updated');
const outdateWarn = document.querySelector('#outdate_warn');

let postDate;
if (updated) {
    postDate = new Date(updated.textContent);
} else {
    postDate = new Date(publish.textContent);
}

const intervalDays = Math.floor((Date.now() - postDate.getTime()) / (24 * 60 * 60 * 1000));
const warnDays = parseInt(outdateWarn.dataset.days);
if (intervalDays >= warnDays) {
    const warnMsg = outdateWarn.dataset.text1 + intervalDays + outdateWarn.dataset.text2;
    outdateWarn.lastChild.textContent = warnMsg;
    outdateWarn.classList.remove('hidden');
}
