2
0
mirror of https://github.com/frappe/books.git synced 2024-12-22 19:09:01 +00:00

fix: return local date for display

This commit is contained in:
18alantom 2023-07-18 14:22:40 +05:30 committed by Alan
parent 3071040f8d
commit 39638ee9c7

View File

@ -46,6 +46,7 @@
</div>
</template>
<script lang="ts">
import { DateTime } from 'luxon';
import { fyo } from 'src/initFyo';
import { defineComponent, nextTick } from 'vue';
import Base from './Base.vue';
@ -66,7 +67,7 @@ export default defineComponent({
}
if (value instanceof Date && !Number.isNaN(value.valueOf())) {
return value.toISOString().split('T')[0];
return DateTime.fromJSDate(value).toISODate();
}
return '';
@ -115,8 +116,6 @@ export default defineComponent({
this.showInput = false;
let value: Date | null = new Date(target.value);
value.setHours(0, 0, 0, 0);
if (Number.isNaN(value.valueOf())) {
value = null;
}