I stack here today. I make an axios call to my api. On succes response I run the function and make a chart on my page from recived data.
It work fine while I leave all aditional transformation inside the method
        mounted() {
            this.month = moment().month("June").format("YYYY-MM");
            axios.get('/data/statistic2/'+this.month)
                .then(response => {
                    this.set = response.data;
                    this.generateChart(response.data);
                })
        },
        methods: {
            generateChart(input) {
                let data = [];
                input.forEach(function(row) {
                    let item = {};
                    item.day = row.day;
                    let timeArray = [row.time1, row.time2,row.time3,row.time4,row.time5];
                    let result = timeArray.filter(function(item) {
                            return item !== null;
                        }).reduce((prev, current) => parseInt(prev) + parseInt(current)); 
                    item.time = result;
                    data.push(item);    
                })
                this.datachart = data;
            },
But when I try to incapsulate this bit of logic in separate method
        mounted() {
            this.month = moment().month("June").format("YYYY-MM");
            axios.get('/data/statistic2/'+this.month)
                .then(response => {
                    this.set = response.data;
                    this.generateChart(response.data);
                })
        },
        methods: {
            generateChart(input) {
                let data = [];
                input.forEach(function(row) {
                    let item = {};
                    item.day = row.day;                 
                    item.time = convertTimeFromDB(row);
                    data.push(item);    
                })
                this.datachart = data;
            },
            convertTimeFromDB(row) {
                let timeArray =  [row.time1, row.time2,row.time3,row.time4,row.time5];
                return timeArray.filter(function(item) {
                        return item !== null;
                    }).reduce((prev, current) => parseInt(prev) + parseInt(current));
            },
I got "Uncaught (in promise) ReferenceError: convertTimeFromDB is not defined"
 
     
    