25 lines
601 B
TypeScript
Raw Normal View History

2019-10-14 17:19:13 +09:00
import { Component, OnInit, Input } from '@angular/core';
import { Info } from '@ucap-webmessenger/protocol-event';
import { DatePipe } from '@angular/common';
2019-10-07 13:49:12 +09:00
@Component({
selector: 'ucap-chat-message-box-date-splitter',
templateUrl: './date-splitter.component.html',
styleUrls: ['./date-splitter.component.scss']
})
export class DateSplitterComponent implements OnInit {
2019-10-14 17:19:13 +09:00
@Input()
message: Info;
2019-10-07 13:49:12 +09:00
2019-10-14 17:19:13 +09:00
dateInfo: string;
constructor(private datePipe: DatePipe) {}
ngOnInit() {
this.dateInfo = this.datePipe.transform(
this.message.sendDate,
'yyyy-MM-dd EEE'
);
}
2019-10-07 13:49:12 +09:00
}