use 'toLocaleDateString()'

This commit is contained in:
Régis Hanol 2017-03-13 16:11:49 +01:00
parent 64680286f4
commit 30d5d61158
1 changed files with 1 additions and 2 deletions

View File

@ -51,8 +51,7 @@ export default {
// don't update counts in category badge nor in oneboxes (except when we force it)
if (isValidLink($link)) {
const html = $badge.html();
const d = new Date();
const key = `${d.getFullYear()}-${d.getMonth()}-${d.getDay()}-${postId}-${href}`;
const key = `${new Date().toLocaleDateString()}-${postId}-${href}`;
if (/^\d+$/.test(html) && !sessionStorage.getItem(key)) {
sessionStorage.setItem(key, true);
$badge.html(parseInt(html, 10) + 1);