diff --git a/app/components/main/TitleCurrentTime.js b/app/components/main/TitleCurrentTime.js
index fe2c6d4..12def37 100644
--- a/app/components/main/TitleCurrentTime.js
+++ b/app/components/main/TitleCurrentTime.js
@@ -5,10 +5,11 @@ import moment from 'moment';
class TitleCurrentTime extends Component {
render() {
- const {currentTime} = this.props;
+ const {currentTime, avg} = this.props;
+ const timeFormat = avg.by.startsWith('min') ? "DD-MM-YYYY HH:mm" : "DD-MM-YYYY HH:mm:ss";
return (
-
{currentTime ? moment(currentTime).format("DD-MM-YYYY HH:mm") : 'Time not selected'}
+ {currentTime ? moment(currentTime).format(timeFormat) : 'Time not selected'}
);
}
}
@@ -18,6 +19,7 @@ TitleCurrentTime.defaultProps = {};
function mapStateToProps(state) {
return {
+ avg: state.main.settings.project.time.avg,
currentTime: state.chart.chartCurrentTime ? new Date(state.chart.chartCurrentTime) : null,
};
}
diff --git a/app/workers/prepareValues.js b/app/workers/prepareValues.js
index 3464951..f02627c 100644
--- a/app/workers/prepareValues.js
+++ b/app/workers/prepareValues.js
@@ -39,7 +39,7 @@ function prepareValues(data, time, rowLength) {
if (time.extreme.frequency < avg.time) {
format = VALUES_AVG;
rows = prepareFormatedValues(rows, time, format);
- } else if (Math.abs(time.extreme.start - rows[0][0].valueOf()) > 0) {
+ } else if (time.extreme.frequency > avg.time || Math.abs(time.extreme.start - rows[0][0].valueOf()) > 0) {
format = VALUES_INTERPOLATED;
rows = prepareInterpolatedValues(rows, time);
}