Added today date in shift-update ts code

This commit is contained in:
Mosiur Rahman
2024-11-29 22:52:12 +06:00
parent d0956b6b17
commit b5cb152d91
4 changed files with 10 additions and 2 deletions

View File

@@ -5,7 +5,6 @@
<div class="search">
<app-search (textChange)="onTextChange($event)"></app-search>
</div>
<p>{{searchTerm}}</p>
<div class="table">
<table>
<thead>

View File

@@ -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 {

View File

@@ -30,6 +30,7 @@ import { Subject, debounceTime, distinctUntilChanged, Subscription } from 'rxjs'
this.textChange.emit(currentValue);
});
this.subscriptions.push(subscription);
console.log(this.subscriptions)
}
ngOnDestroy() {

View File

@@ -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})