Added today date in shift-update ts code
This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
<div class="search">
|
<div class="search">
|
||||||
<app-search (textChange)="onTextChange($event)"></app-search>
|
<app-search (textChange)="onTextChange($event)"></app-search>
|
||||||
</div>
|
</div>
|
||||||
<p>{{searchTerm}}</p>
|
|
||||||
<div class="table">
|
<div class="table">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export class ShiftUpdateComponent implements OnInit, OnDestroy {
|
|||||||
tableHeaderList = ['Date','Details','Remarks','Sales','Reference','Handler', 'Status']
|
tableHeaderList = ['Date','Details','Remarks','Sales','Reference','Handler', 'Status']
|
||||||
updateDataList!: Update[];
|
updateDataList!: Update[];
|
||||||
updateListSubscription!: Subscription;
|
updateListSubscription!: Subscription;
|
||||||
|
todayDate!: String;
|
||||||
|
|
||||||
|
|
||||||
constructor(private updateService: UpdateService) {}
|
constructor(private updateService: UpdateService) {}
|
||||||
@@ -28,6 +29,14 @@ export class ShiftUpdateComponent implements OnInit, OnDestroy {
|
|||||||
this.updateListSubscription = this.updateService.allUpdate().subscribe((update)=>{
|
this.updateListSubscription = this.updateService.allUpdate().subscribe((update)=>{
|
||||||
this.updateDataList = update;
|
this.updateDataList = update;
|
||||||
});
|
});
|
||||||
|
let date = new Date();
|
||||||
|
let dd = String(date.getDate()).padStart(2,'0');
|
||||||
|
let mm = String(date.getMonth()).padStart(2,'0');
|
||||||
|
let yyyy = String(date.getFullYear());
|
||||||
|
let today = `${dd}\\${mm}\\${yyyy}`
|
||||||
|
this.todayDate = today;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import { Subject, debounceTime, distinctUntilChanged, Subscription } from 'rxjs'
|
|||||||
this.textChange.emit(currentValue);
|
this.textChange.emit(currentValue);
|
||||||
});
|
});
|
||||||
this.subscriptions.push(subscription);
|
this.subscriptions.push(subscription);
|
||||||
|
console.log(this.subscriptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ export class searchService {
|
|||||||
constructor(private httpClient: HttpClient){}
|
constructor(private httpClient: HttpClient){}
|
||||||
|
|
||||||
search(term: string){
|
search(term: string){
|
||||||
console.log(term)
|
|
||||||
let params = new HttpParams().set('term',term)
|
let params = new HttpParams().set('term',term)
|
||||||
|
|
||||||
return this.httpClient.post<Backup[]>(BACKUP_GET_URL+"/search",{term})
|
return this.httpClient.post<Backup[]>(BACKUP_GET_URL+"/search",{term})
|
||||||
|
|||||||
Reference in New Issue
Block a user