feat: add format date(#40)
Some checks failed
it-academy/dry-wash-pl/pipeline/pr-main There was a failure building this commit
Some checks failed
it-academy/dry-wash-pl/pipeline/pr-main There was a failure building this commit
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Td, Tr, Link, Select } from '@chakra-ui/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import dayjs from 'dayjs';
|
||||
import { getTimeSlot } from '../../lib/date-helpers';
|
||||
|
||||
const statuses = [
|
||||
'pending' as const,
|
||||
@@ -15,7 +17,8 @@ type GetArrItemType<ArrType> =
|
||||
|
||||
export type OrderProps = {
|
||||
carNumber?: string;
|
||||
washTime?: string;
|
||||
startWashTime?: string;
|
||||
endWashTime?: string;
|
||||
orderDate?: string;
|
||||
status?: GetArrItemType<typeof statuses>;
|
||||
phone?: string;
|
||||
@@ -24,7 +27,8 @@ export type OrderProps = {
|
||||
|
||||
const OrderItem = ({
|
||||
carNumber,
|
||||
washTime,
|
||||
startWashTime,
|
||||
endWashTime,
|
||||
orderDate,
|
||||
status,
|
||||
phone,
|
||||
@@ -39,8 +43,8 @@ const OrderItem = ({
|
||||
return (
|
||||
<Tr>
|
||||
<Td>{carNumber}</Td>
|
||||
<Td>{washTime}</Td>
|
||||
<Td>{orderDate}</Td>
|
||||
<Td>{getTimeSlot(startWashTime, endWashTime)}</Td>
|
||||
<Td>{dayjs(orderDate).format('DD.MM.YYYY')}</Td>
|
||||
<Td>
|
||||
<Select
|
||||
value={statusSelect}
|
||||
|
||||
Reference in New Issue
Block a user