diff --git a/src/components/search/SearchForm.jsx b/src/components/search/SearchForm.jsx index a0f5fdb..092f774 100644 --- a/src/components/search/SearchForm.jsx +++ b/src/components/search/SearchForm.jsx @@ -1,7 +1,7 @@ import { createContext, useContext, useEffect } from 'react'; import { toJS } from 'mobx'; import { observer } from 'mobx-react'; -import { DATE_FORMAT, stores_Context } from './../../config'; +import { DATE_FORMAT, SMALL_DATETIME_FORMAT, stores_Context } from './../../config'; import { SearchOutlined } from '@ant-design/icons'; import { Form, Row, Col, Select, Button, Space, DatePicker } from 'antd'; import moment from 'moment'; @@ -98,7 +98,7 @@ export default observer((props) => { }, { key: 'Date2', - transform: (value) => (value === '' || !Array.isArray(value) ? undefined : moment(value[1]).format(`${DATE_FORMAT} 23:59:59`)), + transform: (value) => (value === '' || !Array.isArray(value) ? undefined : moment(value[1]).format(SMALL_DATETIME_FORMAT)), default: '', }, ], @@ -110,7 +110,7 @@ export default observer((props) => { }, { key: 'DateDiff2', - transform: (value) => (value === '' || !Array.isArray(value) ? undefined : value[1] ? moment(value[1]).format(`${DATE_FORMAT} 23:59:59`) : undefined), + transform: (value) => (value === '' || !Array.isArray(value) ? undefined : value[1] ? moment(value[1]).format(SMALL_DATETIME_FORMAT) : undefined), default: '', }, ], @@ -122,7 +122,7 @@ export default observer((props) => { }, { key: 'Date2', - transform: (value) => (value ? moment(value).format(`YYYY-12-31 23:59:59`) : undefined), + transform: (value) => (value ? moment(value).format(`YYYY-12-31 23:59:00`) : undefined), default: '', }, ], @@ -134,7 +134,7 @@ export default observer((props) => { }, { key: 'DateDiff2', - transform: (value) => (value ? moment(value).format(`YYYY-12-31 23:59:59`) : undefined), + transform: (value) => (value ? moment(value).format(`YYYY-12-31 23:59:00`) : undefined), default: '', }, ], diff --git a/src/config.js b/src/config.js index 433f879..5fdeb46 100644 --- a/src/config.js +++ b/src/config.js @@ -2,4 +2,6 @@ import React from "react"; export const stores_Context = React.createContext(); export const DATE_FORMAT = "YYYY-MM-DD"; +export const SMALL_DATETIME_FORMAT = 'YYYY-MM-DD 23:59:00'; +export const DATETIME_FORMAT = 'YYYY-MM-DD 23:59:59'; export const HT_HOST = process.env.NODE_ENV === "production" ? "https://p9axztuwd7x8a7.mycht.cn" : "http://202.103.68.100:890";