Skip to content

Commit

Permalink
convert fields that match *Date so values display as nice UTC string …
Browse files Browse the repository at this point in the history
…instead of milliseconds since epoch - any field that matches `field.indexOf("Date") !== -1` will automatically be converted
  • Loading branch information
jgoodall committed Mar 24, 2015
1 parent 49a7153 commit 9e8111f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions templates/includes/extraProps.jade
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

span
each key,index in Object.keys(model._values)
if ((key !== "_id") && (key !== "description") && (key !== "vertexType") && (key !== "_type") && (key !== "inEdges") && (key !== "outEdges") && (key !== "name"))
dt #{key}
dd #{model[key]}
each key,index in Object.keys(model._values)
if ((key !== "_id") && (key !== "description") && (key !== "vertexType") && (key !== "_type") && (key !== "inEdges") && (key !== "outEdges") && (key !== "name"))
dt #{key}
- var val = key.indexOf("Date") !== -1 ? new Date(model[key]).toUTCString() : model[key];
dd #{val}

0 comments on commit 9e8111f

Please sign in to comment.