MCPcopy Index your code
hub / github.com/Justineo/github-hovercard / formatTime

Function formatTime

src/hovercard.js:915–922  ·  view source on GitHub ↗
(time, text)

Source from the content-addressed store, hash-verified

913 ]
914
915 function formatTime(time, text) {
916 let t = new Date(time)
917 let formatted =
918 MONTH_NAMES[t.getMonth()] + ' ' + t.getDate() + ', ' + t.getFullYear()
919
920 return encodeHTML`<time datetime="${time}" title="${time}">${text ||
921 formatted}</time>`
922 }
923
924 function getEmoji(unicode) {
925 return unicode.split('-').map(code => String.fromCodePoint(parseInt(code, 16))).join('')

Callers 1

getCardHTMLFunction · 0.70

Calls 1

encodeHTMLFunction · 0.70

Tested by

no test coverage detected