Skip to content

Commit

Permalink
TIMEZONE: Local to user #2
Browse files Browse the repository at this point in the history
  • Loading branch information
keithhackbarth committed Feb 13, 2016
1 parent ea0d384 commit 8251fef
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
18 changes: 15 additions & 3 deletions clowder_server/static/js/dashboard-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,23 @@ var ListItem = React.createClass({
console.log(this.state.collapsed);
},

render: function() {
dateToString: function (itemDate) {
var options = {
year: 'numeric', month: 'long', day: 'numeric',
hour: '2-digit', minute: '2-digit',
hour12: false, timeZoneName: 'short'
},
dateAsString = new Date(itemDate).toLocaleString('en-US', options);

return dateAsString;
},

render: function() {

var listClass = 'service-item list-group-item service',
item = this.props.item,
statusText;
statusText,
dateString = this.dateToString(item.date);

if (item.passing) {
listClass += ' service-passing list-group-item-success';
Expand All @@ -80,7 +92,7 @@ var ListItem = React.createClass({
<strong>{statusText}</strong>
</div>
<div className="col-md-3">
{item.date}
{dateString}
</div>
<div className="col-md-3 pull-right">
+
Expand Down
4 changes: 2 additions & 2 deletions clowder_server/templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% load staticfiles %}

{% block header %}
<meta http-equiv="refresh" content="3000"; URL="http://www.clowder.io/dashboard">
<meta http-equiv="refresh" content="60"; URL="http://www.clowder.io/dashboard">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="{% static "js/dashboard.js" %}"></script>

Expand All @@ -22,7 +22,7 @@
{
'name': '{{ping_name.grouper}}',
'passing': {{last.is_passing|lower}},
'date': '{{last.create|date:"DATETIME_FORMAT"}}',
'date': '{{last.create|date:"c"}}',
'alert': '{{last.get_closest_alert.notify_at|date:"DATETIME_FORMAT"|default:'n/a'}}',
'table': [
['Time', 'Actual Value'],
Expand Down

0 comments on commit 8251fef

Please sign in to comment.