格式化日期;增加未分配导游样式

release
Jimmy Liow 2 years ago
parent 1359ade8c1
commit 664d902b77

@ -5,6 +5,11 @@
background: rgba(255, 255, 255, 0.3);
}
.reservation-highlight {
color: rgba(255, 255, 255, 1);
background-color: rgba(255, 0, 0, 0.6);
}
#error-page {
display: flex;
flex-direction: column;

@ -108,7 +108,7 @@ function Login() {
}}
>
<Button type="primary" htmlType="submit" style={{width: "100%"}}>
Submit
Login
</Button>
</Form.Item>
</Form>

@ -3,7 +3,9 @@ import { useState, useEffect } from 'react';
import { observer } from "mobx-react";
import { toJS } from "mobx";
import { Row, Col, Space, Button, Table, Input, Typography, DatePicker, Radio, Modal, App, Select } from 'antd';
import dayjs from "dayjs";
import { useStore } from '@/stores/StoreContext.js';
import { formatDate, isEmpty } from "@/utils/commons";
import { DATE_PRESETS } from "@/config";
const { Title } = Typography;
@ -14,12 +16,19 @@ function Newest() {
title: 'Reference number',
dataIndex: 'referenceNumber',
key: 'Reference number',
render: (text, record) => <NavLink to={`/reservation/${record.reservationId}`}>{text}</NavLink>,
render: (text, record) => {
const requiredHighlight = dayjs(record.arrivalDate).add(2, 'day').isBefore(dayjs(), 'day') && isEmpty(record.guide);
const linkClassName = requiredHighlight ? 'reservation-highlight' : '';
return (
<NavLink className={linkClassName} to={`/reservation/${record.reservationId}`}>{text}</NavLink>
)
},
},
{
title: 'Arrival date',
dataIndex: 'arrivalDate',
key: 'Arrival date',
render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')),
},
{
title: 'Pax',
@ -34,7 +43,8 @@ function Newest() {
{
title: 'Res. sending date',
key: 'Reservation date',
dataIndex: 'reservationDate'
dataIndex: 'reservationDate',
render: (text, record) => (isEmpty(text) ? '' : dayjs(text).format('YYYY-MM-DD')),
},
{
title: 'Guide',
@ -100,6 +110,12 @@ function Newest() {
}
});
// console.info(dayjs('2023-5-27').add(3, 'day'));
// console.info(dayjs().isSame(dayjs('2023-5-27').add(3, 'day'), 'day'));
// console.info(dayjs().isBefore(dayjs('2023-5-27').add(3, 'day'), 'day'));
// console.info(dayjs('2023-5-28').add(3, 'day'));
// console.info(dayjs().isBefore(dayjs('2023-5-28').add(3, 'day'), 'day'));
useEffect (() => {
if (location.search !== '?back') {
//

Loading…
Cancel
Save