Avoid errors on sites with invalid date info on posts.
This commit is contained in:
parent
1562c4fe0a
commit
e4fd082bde
@ -15,6 +15,7 @@ RelativeDates =
|
||||
cb: @node
|
||||
|
||||
node: ->
|
||||
return unless @info.date
|
||||
dateEl = @nodes.date
|
||||
if Conf['Relative Date Title']
|
||||
$.on dateEl, 'mouseover', => RelativeDates.hover @
|
||||
|
||||
@ -7,7 +7,7 @@ Time =
|
||||
cb: @node
|
||||
|
||||
node: ->
|
||||
return if @isClone
|
||||
return if !@info.date or @isClone
|
||||
{textContent} = @nodes.date
|
||||
@nodes.date.textContent = textContent.match(/^\s*/)[0] + Time.format(Conf['time'], @info.date) + textContent.match(/\s*$/)[0]
|
||||
|
||||
|
||||
@ -41,6 +41,8 @@ class Post
|
||||
flag: @nodes.flag?.title
|
||||
date: if @nodes.date then new Date(@nodes.date.getAttribute('datetime')?.trim() or (@nodes.date.dataset.utc * 1000))
|
||||
|
||||
delete @info.date if @info.date and isNaN(@info.date.getTime())
|
||||
|
||||
if Conf['Anonymize']
|
||||
@info.nameBlock = 'Anonymous'
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user