Browse Source

FIX | format date

stage
Vitalik 3 months ago
parent
commit
576935327b
  1. 2
      src/components/Fields/DateField.tsx
  2. 2
      src/containers/Chats/helpers/get-copied-messages-content.helper.ts
  3. 2
      src/containers/Chats/hooks/use-create-text-message.hook.ts
  4. 2
      src/containers/Ips/configs/columns.config.tsx
  5. 2
      src/containers/Task/components/Form/components/comments/components/item/index.jsx

2
src/components/Fields/DateField.tsx

@ -73,10 +73,8 @@ export const DateField: FC<IProps> = ({ @@ -73,10 +73,8 @@ export const DateField: FC<IProps> = ({
placeholder={placeholder}
suffixIcon={<img src={CalendarSVG} />}
style={{ width: "100%" }}
// onChange={(_, dateString) => onChange(dateString)}
onChange={(date) => {
if (input?.onChange) input?.onChange(date);
// else onChange(moment(date).format("DD-MM-YYYY"));
else onChange(date ? date.format() : null);
}}
format={input?.format ? input?.format : format}

2
src/containers/Chats/helpers/get-copied-messages-content.helper.ts

@ -34,5 +34,5 @@ function getFormattedMessageContent(item: Partial<IChatMessage>) { @@ -34,5 +34,5 @@ function getFormattedMessageContent(item: Partial<IChatMessage>) {
function getDateAndTime(item: Partial<IChatMessage>) {
if (!item.createdAt) return "";
return moment(item.createdAt).format("DD.MM.YY, HH:mm");
return moment(item.createdAt).format("DD-MM-YYYY, HH:mm");
}

2
src/containers/Chats/hooks/use-create-text-message.hook.ts

@ -110,7 +110,7 @@ export const useCreateTextMessage = ({ @@ -110,7 +110,7 @@ export const useCreateTextMessage = ({
const fileStat = dataURLtoFile(
ImgUrl,
`${moment(new Date().toISOString()).format(
"DD.MM.YYYY.HHmmss"
"DD-MM-YYYY.HHmmss"
)}.${fileExt.toLowerCase()}`
);

2
src/containers/Ips/configs/columns.config.tsx

@ -47,7 +47,7 @@ export const columnsConfig: any = [ @@ -47,7 +47,7 @@ export const columnsConfig: any = [
filter: false,
formatter: ({ row }) => {
if (_.isEmpty(row)) return null;
return moment(row.createdAt).format("DD.MM.YYYY H:mm");
return moment(row.createdAt).format("DD-MM-YYYY H:mm");
},
},
];

2
src/containers/Task/components/Form/components/comments/components/item/index.jsx

@ -205,7 +205,7 @@ class Item extends Component<any> { @@ -205,7 +205,7 @@ class Item extends Component<any> {
<div className="footer-com">
<div className="text"> {user.name} </div>
<div className="text">
{moment(item.created_at).format("DD.MM.YYYY HH:mm")}
{moment(item.created_at).format("DD-MM-YYYY HH:mm")}
</div>
</div>
)}

Loading…
Cancel
Save