Skip to content

Commit 26e3e1c

Browse files
committed
Fix default date format string at startup
Not sure what happened when I tried to do this in 39133b1, but evaluating `DEFAULT_DATE` at import time doesn't work because `atom.config.get` returns undefined. So calculate it later and cache it. Test Plan: Reloaded window then opened blame in a big file. Saw my preferred datestring and not the full ISO 8601 format.
1 parent 692fbf1 commit 26e3e1c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/views/blame-line-view.coffee

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@ moment = require 'moment'
66

77
HASH_LENGTH = 7 # github uses this length
88
BLANK_HASH = '-'.repeat(HASH_LENGTH)
9-
DEFAULT_DATE = formatDate moment("2000-01-01T13:17:00 Z")
9+
10+
_defaultDate = null
11+
getDefaultDate = ->
12+
_defaultDate ?= formatDate moment("2014-01-01T13:37:00 Z")
1013

1114

1215
renderLoading = ->
1316
div className: 'blame-line loading',
1417
span className: 'hash', BLANK_HASH
15-
span className: 'date', DEFAULT_DATE
18+
span className: 'date', getDefaultDate()
1619
span className: 'committer', 'Loading'
1720

1821

0 commit comments

Comments
 (0)