Commit ff7f4fe3 by DESKTOP-HF0LVOG\myhr

Update หน้าต่าง admin

parent 37fd070b
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { NgbDate, NgbCalendar, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap'; import { NgbDate, NgbCalendar, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap';
import { NgbModal, ModalDismissReasons } from '@ng-bootstrap/ng-bootstrap';
@Component({ @Component({
selector: 'app-admin-pending', selector: 'app-admin-pending',
...@@ -37,6 +38,8 @@ export class AdminPendingComponent implements OnInit { ...@@ -37,6 +38,8 @@ export class AdminPendingComponent implements OnInit {
page = 1; page = 1;
pageSize = 10; pageSize = 10;
closeResult = '';
countries: Country[] = [ countries: Country[] = [
{ {
catagory: 'string', catagory: 'string',
...@@ -69,7 +72,7 @@ export class AdminPendingComponent implements OnInit { ...@@ -69,7 +72,7 @@ export class AdminPendingComponent implements OnInit {
fromDate: NgbDate | null; fromDate: NgbDate | null;
toDate: NgbDate | null; toDate: NgbDate | null;
constructor(private calendar: NgbCalendar, public formatter: NgbDateParserFormatter) { constructor(private calendar: NgbCalendar, public formatter: NgbDateParserFormatter , private modalService: NgbModal) {
this.fromDate = calendar.getToday(); this.fromDate = calendar.getToday();
this.toDate = calendar.getNext(calendar.getToday(), 'd', 10); this.toDate = calendar.getNext(calendar.getToday(), 'd', 10);
this.refreshCountries(); this.refreshCountries();
...@@ -92,6 +95,24 @@ export class AdminPendingComponent implements OnInit { ...@@ -92,6 +95,24 @@ export class AdminPendingComponent implements OnInit {
} }
} }
open(content) {
this.modalService.open(content, { ariaLabelledBy: 'modal-basic-title' }).result.then((result) => {
this.closeResult = `Closed with: ${result}`;
}, (reason) => {
this.closeResult = `Dismissed ${this.getDismissReason(reason)}`;
});
}
private getDismissReason(reason: any): string {
if (reason === ModalDismissReasons.ESC) {
return 'by pressing ESC';
} else if (reason === ModalDismissReasons.BACKDROP_CLICK) {
return 'by clicking on a backdrop';
} else {
return `with: ${reason}`;
}
}
isHovered(date: NgbDate) { isHovered(date: NgbDate) {
return this.fromDate && !this.toDate && this.hoveredDate && date.after(this.fromDate) && date.before(this.hoveredDate); return this.fromDate && !this.toDate && this.hoveredDate && date.after(this.fromDate) && date.before(this.hoveredDate);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment