accept string and date in toLocalDate() util
This commit is contained in:
@@ -31,7 +31,7 @@ export function toFixedRounded(num: number, precision: number): number {
|
||||
return Number((Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision)).toFixed(precision))
|
||||
}
|
||||
|
||||
export function toLocalDate(value: string) {
|
||||
export function toLocalDate(value: string | Date) {
|
||||
const date = new Date(value);
|
||||
return date.toLocaleDateString('de-DE', { day: '2-digit', month: 'short', year: 'numeric' });
|
||||
// return date.toLocaleDateString('de-DE', { day: '2-digit', month: '2-digit', year: 'numeric' });
|
||||
@@ -71,6 +71,10 @@ export function bgColorForString(input: string): string {
|
||||
return randomColors[charCodeSum % randomColors.length];
|
||||
}
|
||||
|
||||
export function clearSelection() {
|
||||
window.getSelection()?.removeAllRanges();
|
||||
};
|
||||
|
||||
const promise = () => new Promise((resolve) => setTimeout(resolve, 2000))
|
||||
export function testToast() {
|
||||
let delay = 150
|
||||
|
||||
Reference in New Issue
Block a user