hotFix_vnJsonValue_showHours #1689

Merged
alexm merged 8 commits from hotFix_vnJsonValue_showHours into master 2025-04-08 13:01:00 +00:00
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
<script setup> <script setup>
import { watch } from 'vue'; import { watch } from 'vue';
import { toDateString } from 'src/filters'; import { toDateHourMinSec } from 'src/filters';
const props = defineProps({ const props = defineProps({
value: { type: [String, Number, Boolean, Object], default: undefined }, value: { type: [String, Number, Boolean, Object], default: undefined },
@ -40,7 +40,7 @@ const updateValue = () => {
break; break;
case 'object': case 'object':
if (props.value instanceof Date) { if (props.value instanceof Date) {
t = toDateString(props.value); t = toDateHourMinSec(props.value);
} else { } else {
t = props.value.toString(); t = props.value.toString();
} }

View File

@ -65,7 +65,7 @@ describe('VnJsonValue', () => {
const date = new Date('2023-01-01'); const date = new Date('2023-01-01');
const wrapper = buildComponent({ value: date }); const wrapper = buildComponent({ value: date });
const span = wrapper.find('span'); const span = wrapper.find('span');
expect(span.text()).toBe('2023-01-01'); expect(span.text()).toBe('01/01/2023, 01:00:00');
expect(span.classes()).toContain('json-object'); expect(span.classes()).toContain('json-object');
}); });