Replaced old downsampleSeries() method by new

DataProcessingService.groupBy()
This commit is contained in:
Alexander Zobnin
2016-01-24 12:59:17 +03:00
parent 3ded90efec
commit c64dd1d874
2 changed files with 16 additions and 8 deletions

View File

@@ -1,7 +1,8 @@
define([
'lodash'
'lodash',
'moment'
],
function () {
function (_, moment) {
'use strict';
function utils() {
@@ -40,6 +41,12 @@ function () {
return new RegExp(pattern, flags);
};
this.parseInterval = function(interval) {
var intervalPattern = /(^[\d]+)(y|M|w|d|h|m|s)/g;
var momentInterval = intervalPattern.exec(interval);
return moment.duration(Number(momentInterval[1]), momentInterval[2]).valueOf();
};
}
return new utils();