* Chore disable git submodule for web-client and app-backend * Chore add newest source code of app-backend and web-client --------- Co-authored-by: Hien To <tominhhien97@gmail.com>
16 lines
454 B
TypeScript
16 lines
454 B
TypeScript
export const isToday = (timestamp: number) => {
|
|
const today = new Date();
|
|
return today.setHours(0, 0, 0, 0) == new Date(timestamp).setHours(0, 0, 0, 0);
|
|
};
|
|
|
|
export const displayDate = (timestamp: number) => {
|
|
let displayDate = new Date(timestamp).toLocaleString();
|
|
if (isToday(timestamp)) {
|
|
displayDate = new Date(timestamp).toLocaleTimeString(undefined, {
|
|
hour: "2-digit",
|
|
minute: "2-digit",
|
|
});
|
|
}
|
|
return displayDate;
|
|
};
|