mirror of
https://github.com/discourse/discourse.git
synced 2024-11-30 18:13:58 +08:00
use 'toLocaleDateString()'
This commit is contained in:
parent
64680286f4
commit
30d5d61158
|
@ -51,8 +51,7 @@ export default {
|
||||||
// don't update counts in category badge nor in oneboxes (except when we force it)
|
// don't update counts in category badge nor in oneboxes (except when we force it)
|
||||||
if (isValidLink($link)) {
|
if (isValidLink($link)) {
|
||||||
const html = $badge.html();
|
const html = $badge.html();
|
||||||
const d = new Date();
|
const key = `${new Date().toLocaleDateString()}-${postId}-${href}`;
|
||||||
const key = `${d.getFullYear()}-${d.getMonth()}-${d.getDay()}-${postId}-${href}`;
|
|
||||||
if (/^\d+$/.test(html) && !sessionStorage.getItem(key)) {
|
if (/^\d+$/.test(html) && !sessionStorage.getItem(key)) {
|
||||||
sessionStorage.setItem(key, true);
|
sessionStorage.setItem(key, true);
|
||||||
$badge.html(parseInt(html, 10) + 1);
|
$badge.html(parseInt(html, 10) + 1);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user