Fix momentjs in project list view

This commit is contained in:
James Allen 2014-03-07 14:41:01 +00:00
parent a0b02d85f5
commit 9c20d1d604
2 changed files with 11 additions and 4 deletions

View file

@ -144,6 +144,12 @@ block content
mixin tag('{{ project_id }}', '{{ tagName }}', true)
- locals.supressDefaultJs = true
script
window.requirejs = {
"paths" : {
"moment": "libs/moment"
}
};
script(
data-main=jsPath+'list.js?fingerprint='+fingerprint(jsPath + 'list.js'),
baseurl=jsPath,

View file

@ -1,16 +1,17 @@
require [
"tags"
"moment"
"gui"
"libs/moment"
"libs/underscore"
"libs/fineuploader"
"libs/jquery.storage"
], (tagsManager)->
], (tagsManager, moment)->
$('.isoDate').each (i, d)->
html = $(d)
unparsedDate = html.text()
formatedDate = moment(unparsedDate).format('LLL')
unparsedDate = html.text().trim()
console.log unparsedDate
formatedDate = moment(unparsedDate).format("Do MMM YYYY, h:mm:ss a")
html.text(formatedDate)
refreshProjectFilter = ->