tuning import. listing, edit
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { string } from "yup";
|
||||
|
||||
export function clearTag(htmlString: string | undefined) {
|
||||
return htmlString?.replace(/(<([^>]+)>)/gi, "");
|
||||
}
|
||||
@@ -9,3 +11,9 @@ export function limitString(anyString: string | undefined, limit: number = 50) {
|
||||
export function makeExcerpt(htmlString: string | undefined, limit: number = 50) {
|
||||
return limitString(clearTag(htmlString ?? ''), limit);
|
||||
}
|
||||
|
||||
export function capitalizeFirstLetter(text: string) {
|
||||
return text.charAt(0).toUpperCase() + text.slice(1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ export function fDateTime(date: Date | string | number) {
|
||||
return format(new Date(date), 'dd MMM yyyy p');
|
||||
}
|
||||
|
||||
export function fDateTimesecond(date: Date | string | number) {
|
||||
return format(new Date(date), 'dd MMM yyyy HH:mm:ss');
|
||||
}
|
||||
|
||||
export function fTimestamp(date: Date | string | number) {
|
||||
return getTime(new Date(date));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user