Skip to main content
Version: v4

Date

CometChatDate is a widget which is used to show the date and time. You can also customize the appearance of this widget by modifying its logic.

How to integrate CometChatDate ?

<CometChatDate
timeStamp={timestamp}
style={messageBubbleDateStyle}
pattern={"timeFormat"}
customDateString={datePattern}
/>

Properties

ParametersTypeDescription
timeStampnumberUsed to set the date
pattern'timeFormat' | 'dayDateFormat' | 'dayDateTimeFormat'Used to set pattern with different logics

timeFormat, dayDateFormat, dayDateTimeFormat
customDateStringstringtext to show instead of date from DateTime object
styleDateStyleInterfaceused to customize the appearance of this view

DateStyleInterface

ParametersTypeDescription
textColorstringcolour of date text
textFontFontStyleInterfacefont style of text
borderBorderStyleInterfaceborder for date
borderRadiusnumberborder radius for date
heightnumber | stringheight of the date
widthnumber | stringwidth of the date
backgroundColorstringbackground colour to date