25 lines
623 B
TypeScript
Raw Normal View History

2019-10-14 17:19:13 +09:00
import { Component, OnInit, Input } from '@angular/core';
2019-11-06 13:48:06 +09:00
import { Info, EventJson } from '@ucap-webmessenger/protocol-event';
2019-10-14 17:19:13 +09:00
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()
2019-11-06 13:48:06 +09:00
message: Info<EventJson>;
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,
2019-10-21 18:10:39 +09:00
'yyyy.MM.dd EEE'
2019-10-14 17:19:13 +09:00
);
}
2019-10-07 13:49:12 +09:00
}