Add counter to localstorage

This commit is contained in:
Peter Maquiran
2021-07-21 22:44:24 +01:00
parent f604c72575
commit fe211ae53d
6 changed files with 23 additions and 32 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
<ion-tab-button tab="events">
<!-- <ion-icon name="home"></ion-icon> -->
<ion-icon class="nav-icon" src="assets/images/icons-nav-home.svg"></ion-icon>
<ion-badge color="danger">{{totalEvent}}</ion-badge>
<ion-badge color="danger">{{toDayEventStorage.eventsList.length}}</ion-badge>
<ion-label>Início</ion-label>
</ion-tab-button>
+4 -27
View File
@@ -10,6 +10,7 @@ import { NotificationsService } from '../services/notifications.service';
import { ModalController, AlertController, AnimationController, Platform } from '@ionic/angular';
import { NavigationExtras,Router,ActivatedRoute } from '@angular/router';
import { ToastService } from '../services/toast.service';
import { ToDayEventStorage } from '../store/to-day-event-storage.service';
@Component({
selector: 'app-home',
@@ -25,6 +26,9 @@ export class HomePage implements OnInit {
totalExpediente = 0;
profile: string;
toDayEventStorage = ToDayEventStorage
adding: "intervenient" | "CC" = "intervenient";
mobileComponent = {
showAddNewEvent: false,
@@ -71,33 +75,6 @@ export class HomePage implements OnInit {
this.mobilefirstConnect();
this.notificatinsservice.onReceviNotification();
}
this.count();
}
async count() {
// let date = new Date();
// date.setMonth(date.getMonth() + 1);
// let start = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
// let end = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " 23:59:59";
// this.profile = "mdgpr";
// if (this.profile == "mdgpr") {
// let mdOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
// let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
// this.eventsList = mdOficialEvents.concat(mdPessoalEvents)
// this.totalEvent = this.eventsList.length;
// }
// else {
// let prOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
// let prPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
// this.eventsList = prOficialEvents.concat(prPessoalEvents)
// this.totalEvent = this.eventsList.length;
// }
}