Merge pull request 'hotFix_vnJsonValue_showHours' (!1689) from hotFix_vnJsonValue_showHours into master
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #1689 Reviewed-by: Jon Elias <jon@verdnatura.es>
This commit is contained in:
commit
9d00668acb
|
@ -1,6 +1,6 @@
|
|||
<script setup>
|
||||
import { watch } from 'vue';
|
||||
import { toDateString } from 'src/filters';
|
||||
import { toDateHourMinSec } from 'src/filters';
|
||||
|
||||
const props = defineProps({
|
||||
value: { type: [String, Number, Boolean, Object], default: undefined },
|
||||
|
@ -40,7 +40,7 @@ const updateValue = () => {
|
|||
break;
|
||||
case 'object':
|
||||
if (props.value instanceof Date) {
|
||||
t = toDateString(props.value);
|
||||
t = toDateHourMinSec(props.value);
|
||||
} else {
|
||||
t = props.value.toString();
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ describe('VnJsonValue', () => {
|
|||
const date = new Date('2023-01-01');
|
||||
const wrapper = buildComponent({ value: date });
|
||||
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');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue