fix: refs #8647 fixed inputDateTime modelValue warning
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2025-04-16 11:42:58 +02:00
parent 75780f1ad2
commit 2ef4a8c5de
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ const styleAttrs = computed(() => {
const mask = 'DD-MM-YYYY HH:mm';
const selectedDate = computed({
get() {
if (!model.value) return new Date(model.value);
if (!model.value) return JSON.stringify(new Date(model.value));
return date.formatDate(new Date(model.value), mask);
},
set(value) {

View File

@ -33,7 +33,7 @@ describe('VnInputDateTime', () => {
it('handles null date value', async () => {
generateWrapper(null, false, true);
await vm.$nextTick();
expect(vm.selectedDate).toBeInstanceOf(Date);
expect(vm.selectedDate).not.toBe(null);
});
it('updates the model value when a new datetime is set', async () => {