mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-22 18:30:14 +01:00
refactor(traffic service): return month without year for months
This commit is contained in:
parent
22a78f71a3
commit
5d543a4eeb
2 changed files with 2 additions and 4 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ export class TrafficRevealCardComponent implements OnDestroy {
|
||||||
|
|
||||||
getTrafficFrontCardData(period: string) {
|
getTrafficFrontCardData(period: string) {
|
||||||
this.trafficListService.getTrafficListData(period)
|
this.trafficListService.getTrafficListData(period)
|
||||||
.pipe(takeWhile(() => this.alive ))
|
.pipe(takeWhile(() => this.alive))
|
||||||
.subscribe(trafficListData => {
|
.subscribe(trafficListData => {
|
||||||
this.trafficListData = trafficListData;
|
this.trafficListData = trafficListData;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue