app/assets/javascripts/components/posts.js.cjsx in octodmin-0.3.4 vs app/assets/javascripts/components/posts.js.cjsx in octodmin-0.3.5
- old
+ new
@@ -116,10 +116,16 @@
else if @props.post.deleted
"danger"
else
"default"
+ isoDate: ->
+ try
+ (new Date(@props.post.date.replace(/-/g, "/"))).toISOString()
+ catch e
+ null
+
handleEdit: ->
@transitionTo("post_edit", post_id: @props.post.identifier)
handleRevert: ->
return if @state.loading
@@ -163,10 +169,10 @@
render: ->
<div className="panel panel-#{@panelClass()}">
<div className="panel-heading clearfix">
<h3 className="panel-title pull-left">{@props.post.title}</h3>
<div className="pull-right">
- {moment((new Date(@props.post.date.replace(/-/g, "/"))).toISOString()).format("LLL")}
+ {if @isoDate() then moment(@isoDate()).format("LLL") else ""}
</div>
</div>
<div className="panel-body">
<div className="row">
<div className="col-sm-9 excerpt" dangerouslySetInnerHTML={{__html: @props.post.excerpt }} />