getDateHeaderMessage static method

String getDateHeaderMessage({
  1. required int messageSentTime,
  2. String format = "MMMM dd, yyyy",
})

Generates a header message indicating the date of a message based on its sending time, allowing customization of the date format.

@param messageSentTime The timestamp of the message sending time. @param format Optional parameter that specifies the format of the date string. Defaults to "MMMM dd, yyyy". @return A string representing the date of the message formatted according to the given format or the default format if no format is specified.

Implementation

static String getDateHeaderMessage(
    {required int messageSentTime, String format = "MMMM dd, yyyy"}) {
  // Convert message sending time to date string
  return getDateString(messageSentTime, format);
}