mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
fix(client): fix output time in date-picker in date-only mode (#4778)
This commit is contained in:
parent
850a1dca64
commit
9ba64ee6f1
@ -76,6 +76,12 @@ describe('moment2str', () => {
|
|||||||
expect(str).toBe(dayjs('2023-06-21 10:10:00').toISOString());
|
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', () => {
|
test('with time', () => {
|
||||||
const m = dayjs('2023-06-21 10:10:00');
|
const m = dayjs('2023-06-21 10:10:00');
|
||||||
const str = moment2str(m, { showTime: true });
|
const str = moment2str(m, { showTime: true });
|
||||||
|
@ -71,7 +71,7 @@ export const moment2str = (value?: Dayjs | null, options: Moment2strOptions = {}
|
|||||||
if (typeof gmt === 'boolean') {
|
if (typeof gmt === 'boolean') {
|
||||||
return gmt ? toGmtByPicker(value, picker) : toLocalByPicker(value, picker);
|
return gmt ? toGmtByPicker(value, picker) : toLocalByPicker(value, picker);
|
||||||
}
|
}
|
||||||
return toGmtByPicker(value, picker);
|
return toLocalByPicker(value, picker);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const mapDatePicker = function () {
|
export const mapDatePicker = function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user