base structure

This commit is contained in:
hamid zarghami
2025-11-12 11:45:13 +03:30
parent d9560b7d32
commit d36b8e40f0
26 changed files with 1083 additions and 8 deletions
+27
View File
@@ -0,0 +1,27 @@
export const formatDate = (dateString: string): string => {
const date = new Date(dateString);
return new Intl.DateTimeFormat("fa-IR", {
year: "numeric",
month: "long",
day: "numeric",
hour: "2-digit",
minute: "2-digit",
}).format(date);
};
export const formatDateShort = (dateString: string): string => {
const date = new Date(dateString);
return new Intl.DateTimeFormat("fa-IR", {
year: "numeric",
month: "short",
day: "numeric",
}).format(date);
};
export const formatPrice = (price: number): string => {
return new Intl.NumberFormat("fa-IR", {
style: "decimal",
minimumFractionDigits: 0,
maximumFractionDigits: 0,
}).format(price);
};