diff options
author | Tulir Asokan <tulir@maunium.net> | 2019-04-10 01:42:27 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2019-04-10 01:42:27 +0300 |
commit | 06c306bee91ce2b7e7b5f32fad7c3f8b5b38d883 (patch) | |
tree | c5deabd2e86e3a40d86a7173a1a49c874ad99690 /ui/messages/base.go | |
parent | bbde1219479bb257c7bc1f9546bd67e8a151198c (diff) |
Fix date change messages and input submit handling
Diffstat (limited to 'ui/messages/base.go')
-rw-r--r-- | ui/messages/base.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/messages/base.go b/ui/messages/base.go index d9db866..f54c2cd 100644 --- a/ui/messages/base.go +++ b/ui/messages/base.go @@ -191,6 +191,12 @@ func (msg *BaseMessage) FormatDate() string { return msg.MsgTimestamp.Format(DateFormat) } +func (msg *BaseMessage) SameDate(message UIMessage) bool { + year1, month1, day1 := msg.Timestamp().Date() + year2, month2, day2 := message.Timestamp().Date() + return day1 == day2 && month1 == month2 && year1 == year2 +} + func (msg *BaseMessage) ID() string { if len(msg.MsgID) == 0 { return msg.MsgTxnID |