Skip to main content

Timestamp

Timestamps are used to display the time and date (with customizable color, position and locale) below the chat message. They are disabled by default.

To enable timestamps:

  1. Set theme.message.timestamps.enable to true. The format displayed by default for all locales and formatted with toLocaleString will look like 29 Jun, 12:40:07.

Example in webchat index.js file.

theme: {
message: {
timestamps: {
enable: true,
},
},
},
  1. Define style and format properties:
theme: {
message: {
timestamps: {
format: () => {
return new Date().toLocaleString();
},
style: {
color: "blue",
},
},
},
},