add update time

This commit is contained in:
AmirHossein Mahmoodi
2025-09-20 11:19:24 +03:30
parent af2d8ec7de
commit f2b3d380bf
2 changed files with 17 additions and 2 deletions

View File

@@ -1,10 +1,11 @@
"use client";
import DataTableWithAuth from "@/core/components/DataTableWithAuth";
import { GET_RECEIPT_DAMAGE_ITEMS_LIST } from "@/core/utils/routes";
import { Box } from "@mui/material";
import { Box, Typography } from "@mui/material";
import { useMemo } from "react";
import Toolbar from "./Toolbar";
import RowActions from "./RowActions";
import moment from "jalali-moment";
const DamagesList = () => {
const columns = useMemo(
@@ -49,6 +50,19 @@ const DamagesList = () => {
size: 100,
Cell: ({ renderedCellValue }) => (renderedCellValue / 1).toLocaleString(),
},
{
accessorKey: "update_time",
header: "تاریخ بروزرسانی",
id: "update_time",
enableColumnFilter: false,
datatype: "date",
filterMode: "equals",
Cell: ({ renderedCellValue }) => (
<Typography variant="body2">
{renderedCellValue ? moment(renderedCellValue).locale("fa").format("YYYY/MM/DD") : "-"}
</Typography>
),
},
{
accessorKey: "status",
header: "وضعیت",

View File

@@ -19,6 +19,7 @@ import { number, object } from "yup";
import useDamageItemList from "@/lib/hooks/useDamageItemList";
import DamagePrice from "./DamagePrice";
import { yupResolver } from "@hookform/resolvers/yup";
import moment from "jalali-moment";
const schema = object({
id: number().required("لطفا نوع خسارت را وارد کنید!!!"),
@@ -86,7 +87,7 @@ const DamageItem = ({ baseOnChange, baseDamageItems }) => {
<Autocomplete
options={damageItemList || []}
size={"small"}
getOptionLabel={(option) => option.title}
getOptionLabel={(option) => `${option.title} - بروزرسانی: ${option.update_time ? moment(option.update_time).locale("fa").format("YYYY/MM/DD") : ""}` }
isOptionEqualToValue={(option, value) => option.id === value.id}
loading={loadingDamageItemList}
renderInput={(params) => (