(improvement)(chat-sdk) set ant locale to zh-cn and optimize range picker style (#1489)

This commit is contained in:
williamhliu
2024-07-30 19:32:30 +08:00
committed by GitHub
parent 52a584b9a4
commit b5fa54a754
2 changed files with 143 additions and 138 deletions

View File

@@ -9,8 +9,13 @@ import MarkDown from '../ChatMsg/MarkDown';
import classNames from 'classnames';
import { isMobile } from '../../utils/utils';
import dayjs, { Dayjs } from 'dayjs';
import locale from 'antd/locale/zh_CN';
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
import 'dayjs/locale/zh-cn';
dayjs.extend(quarterOfYear);
dayjs.locale('zh-cn');
const { RangePicker } = DatePicker;
@@ -257,24 +262,17 @@ const ParseTip: React.FC<Props> = ({
<RangePicker
value={[dayjs(startDate), dayjs(endDate)]}
onChange={onDateInfoChange}
format="YYYY/MM/DD"
format="YYYY-MM-DD"
renderExtraFooter={() => (
<Row gutter={[28, 28]}>
{Object.keys(ranges).map(key => (
<Col key={key}>
<label
style={{
backgroundColor: '#F0FDFF',
borderColor: '#33BDFC',
color: '#33BDFC',
borderWidth: 1,
borderStyle: 'solid',
cursor: 'pointer',
}}
<Button
size="small"
onClick={() => handlePresetClick(ranges[key as RangeKeys])}
>
{key}
</label>
</Button>
</Col>
))}
</Row>