| | |
| | | export class CalendarComponent implements OnInit, OnDestroy { |
| | | |
| | | data: any = {}; |
| | | |
| | | public calendarDayCells:{ |
| | | [key : string] : { |
| | | 'status': string, |
| | | 'statusName': string, |
| | | 'data': {} |
| | | } |
| | | } = {}; |
| | | constructor( |
| | | private deviceService: DeviceService, |
| | | private http: _HttpClient, |
| | |
| | | } |
| | | |
| | | ngOnInit() { |
| | | |
| | | const day = Number(moment().format('DD')); |
| | | for(let index = 1;index <= day; index++) { |
| | | this.calendarDayCells[('0'+index).slice(-2)] = { |
| | | status: 'processing', |
| | | statusName: '加载中', |
| | | data: {} |
| | | } |
| | | } |
| | | // console.log(this.calendarDayCells); |
| | | } |
| | | |
| | | ngOnDestroy(): void { |
| | | } |
| | | calendarClick(event,day) { |
| | | console.log(day); |
| | | // 日历单元格 被点击 |
| | | calendarClick(mo: moment.Moment) { |
| | | console.log(mo.format('DD')); |
| | | } |
| | | public isExpire(mo: moment.Moment):boolean { |
| | | // console.log(moment().valueOf()); |
| | | // console.log(mo.valueOf()); |
| | | // console.log(moment().valueOf() < mo.valueOf()); |
| | | return moment().valueOf() < mo.valueOf(); |
| | | } |
| | | loadCalendar(event) { |
| | | console.log(event); |
| | | } |
| | | } |