refactor(traffic service): return month without year for months

This commit is contained in:
Sergey Andrievskiy 2019-06-22 17:55:35 +03:00
parent 22a78f71a3
commit 5d543a4eeb
2 changed files with 2 additions and 4 deletions

View file

@ -31,10 +31,8 @@ export class TrafficListService extends TrafficListData {
private getDataMonth(): TrafficList[] { private getDataMonth(): TrafficList[] {
const getFirstDateInPeriod = () => { const getFirstDateInPeriod = () => {
const months = this.period.getMonths(); const months = this.period.getMonths();
const date = new Date();
const prevYear = date.getFullYear() - 1;
return `${months[months.length - 1]}, ${prevYear}`; return months[months.length - 1];
}; };
return this.reduceData(this.period.getMonths(), getFirstDateInPeriod); return this.reduceData(this.period.getMonths(), getFirstDateInPeriod);