fix for wrong locale and text issues #8840 (#8854)

fixes https://github.com/grafana/grafana/issues/8840
by setting a default locale. Also uses fromNow(true) to work arround the replace.
This commit is contained in:
Daniel Koehler 2017-07-14 21:58:27 +02:00 committed by Torkel Ödegaard
parent a045f175b6
commit c5f6cf0809

View File

@ -125,7 +125,7 @@ class AlertListPanel extends PanelCtrl {
.then(res => {
this.currentAlerts = this.sortResult(_.map(res, al => {
al.stateModel = alertDef.getStateDisplayModel(al.state);
al.newStateDateAgo = moment(al.newStateDate).fromNow().replace(" ago", "");
al.newStateDateAgo = moment(al.newStateDate).locale('en').fromNow(true);
return al;
}));
});