mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
13 lines
328 B
TypeScript
13 lines
328 B
TypeScript
import dayjs from "dayjs";
|
|
import relativeTime from "dayjs/plugin/relativeTime";
|
|
|
|
dayjs.extend(relativeTime);
|
|
|
|
/**
|
|
* Returns a human-readable string describing the passing of time
|
|
* Broken into its own module for testing purposes
|
|
*/
|
|
export function createDayString(time: string): string {
|
|
return dayjs().to(dayjs(time));
|
|
}
|