fix(client): fix output time in date-picker in date-only mode (#4778)
Some checks are pending
Build Docker Image / build-and-push (push) Waiting to run
Build Pro Image / build-and-push (push) Waiting to run
deploy client docs / Build (push) Waiting to run
E2E / Build (push) Waiting to run
E2E / Core and plugins (push) Blocked by required conditions
E2E / plugin-workflow (push) Blocked by required conditions
E2E / plugin-workflow-approval (push) Blocked by required conditions
E2E / plugin-data-source-main (push) Blocked by required conditions
E2E / Comment on PR (push) Blocked by required conditions
NocoBase FrontEnd Test / frontend-test (18) (push) Waiting to run

This commit is contained in:
Junyi 2024-07-08 23:13:05 +08:00 committed by GitHub
parent 850a1dca64
commit 9ba64ee6f1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -76,6 +76,12 @@ describe('moment2str', () => {
expect(str).toBe(dayjs('2023-06-21 10:10:00').toISOString());
});
test('gmt not configured', () => {
const d = dayjs('2024-06-30');
const str = moment2str(d);
expect(str).toBe(dayjs('2024-06-30 00:00:00').toISOString());
});
test('with time', () => {
const m = dayjs('2023-06-21 10:10:00');
const str = moment2str(m, { showTime: true });

View File

@ -71,7 +71,7 @@ export const moment2str = (value?: Dayjs | null, options: Moment2strOptions = {}
if (typeof gmt === 'boolean') {
return gmt ? toGmtByPicker(value, picker) : toLocalByPicker(value, picker);
}
return toGmtByPicker(value, picker);
return toLocalByPicker(value, picker);
};
export const mapDatePicker = function () {