crud schedule

This commit is contained in:
hamid zarghami
2025-11-18 09:55:04 +03:30
parent ec14497f59
commit bf9424362c
8 changed files with 166 additions and 15 deletions
+15
View File
@@ -9,3 +9,18 @@ import { twMerge } from "tailwind-merge";
export const clx = (...classes: (string | boolean | undefined)[]): string => {
return twMerge(classes.filter(Boolean).join(" "));
};
/**
* Converts time string to HH:mm format
* @param time - Time string in various formats (HH:mm:ss, HH:mm, etc.)
* @returns Time string in HH:mm format
*/
export const formatTimeToHHmm = (time: string): string => {
if (!time) return '';
// اگر زمان به فرمت HH:mm:ss باشد، فقط HH:mm را برمی‌گرداند
if (time.includes(':') && time.split(':').length === 3) {
return time.substring(0, 5);
}
// اگر به فرمت HH:mm باشد، همان را برمی‌گرداند
return time;
};