Preserve whitespace around time when reformatting.

This commit is contained in:
ccd0 2018-01-25 03:41:44 -08:00
parent f004f2e353
commit 498cd667f9

View File

@ -8,7 +8,9 @@ Time =
node: ->
return if @isClone
@nodes.date.textContent = Time.format Conf['time'], @info.date
{textContent} = @nodes.date
@nodes.date.textContent = textContent.match(/^\s*/)[0] + Time.format(Conf['time'], @info.date) + textContent.match(/\s*$/)[0]
format: (formatString, date) ->
formatString.replace /%(.)/g, (s, c) ->
if c of Time.formatters