import { type ClassValue, clsx } from "clsx"; import { twMerge } from "tailwind-merge"; import dayjs from "dayjs"; import utc from "dayjs/plugin/utc"; import jalaliday from "jalaliday"; import JSEncrypt from "jsencrypt"; import timezone from "dayjs/plugin/timezone"; import moment from "jalali-moment"; dayjs.extend(jalaliday); dayjs.extend(utc); dayjs.extend(timezone); // dayjs.tz.setDefault("Etc/GMT-3:30"); export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } export function convertDate(date: string) { const convertedDate = dayjs(date + "Z") .calendar("jalali") .locale("fa") .format("YYYY/M/DD"); return convertedDate; } export function convertFullTime(date: string) { const convertedDate = dayjs(date + "Z") .calendar("jalali") .locale("fa") .format(" HH:mm:ss - YYYY/M/D"); return convertedDate; } export function Decrypt(encryptedData: any, privateKey: any) { const decryptor = new JSEncrypt(); decryptor.setPrivateKey(privateKey); const decrypted = decryptor.decrypt(encryptedData); return decrypted; }