Skip to content

Commit

Permalink
[#2494] Only replace valid dates with moment.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Oderbolz committed Jul 9, 2015
1 parent c01c954 commit 45ac16e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ckan/public/base/javascript/main.js
Expand Up @@ -35,7 +35,9 @@ this.ckan = this.ckan || {};
jQuery('.datetime').each(function() {
moment.locale(browserLocale);
var date = moment(jQuery(this).data('datetime'));
jQuery(this).html(date.format("LL, LT ([UTC]Z)"));
if (date.isValid()) {
jQuery(this).html(date.format("LL, LT ([UTC]Z)"));
}
jQuery(this).show();
})

Expand Down

0 comments on commit 45ac16e

Please sign in to comment.