refactor(client): set default end time for time range in filter block to 23:59:59" (#6012)

* fix: datetime format

* fix: bug
This commit is contained in:
Katherine 2025-01-08 14:47:05 +08:00 committed by GitHub
parent a17b0ca63b
commit 35238cc02e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ DatePicker.RangePicker = function RangePicker(props: any) {
...props,
format: getDateTimeFormat(targetPicker, targetDateFormat, showTime, timeFormat),
picker: targetPicker,
showTime: showTime ? { defaultValue: [dayjs('00:00:00', 'HH:mm:ss'), dayjs('00:00:00', 'HH:mm:ss')] } : false,
showTime: showTime ? { defaultValue: [dayjs('00:00:00', 'HH:mm:ss'), dayjs('23:59:59', 'HH:mm:ss')] } : false,
};
const [stateProps, setStateProps] = useState(newProps);
if (isFilterAction) {

View File

@ -229,7 +229,7 @@ export const getPickerFormat = (picker) => {
export const getDateTimeFormat = (picker, format, showTime, timeFormat) => {
if (picker === 'date') {
if (showTime) {
return format + timeFormat || 'HH:mm:ss';
return `${format} ${timeFormat || 'HH:mm:ss'}`;
}
return format;
}