@cometchat/chat-uikit-react-native
Version:
Ready-to-use Chat UI Components for React Native
40 lines (39 loc) • 1.27 kB
TypeScript
import React from "react";
import { DateHelper } from "../../helper/dateHelper";
import { ValueOf } from "../../helper/types";
import { DateStyle } from "./styles";
/**
* Props for the CometChatDate component.
*/
export interface CometChatDateInterface {
/**
* Unix epoch time to be formatted and displayed.
*/
timeStamp?: number;
/**
* Pattern for formatting the date.
* One of the following values:
* - timeFormat: "hh:mm a".
* - dayDateFormat: Today, Yesterday, week-day or "d MMM, yyyy".
* - dayWeekDayDateTimeFormat: Today, Yesterday, week-day or "dd/mm/yyyy".
*/
pattern?: ValueOf<typeof DateHelper.patterns>;
/**
* A custom date string to override the formatted date.
*/
customDateString?: string;
/**
* Custom styles for the date component.
*/
style?: DateStyle;
}
/**
* CometChatDate is a component for displaying a formatted date/time.
*
* If a customDateString is provided, it will be displayed instead of the formatted date.
* Otherwise, the component formats the provided timeStamp using the given pattern.
*
* - Props for the component.
* The rendered date view.
*/
export declare const CometChatDate: (props: CometChatDateInterface) => React.JSX.Element;