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