[utils] IsoDateTime, do not set time if used as date input
This commit is contained in:
parent
6a6afcb2d4
commit
6f053d849a
|
@ -127,7 +127,7 @@ export default defineComponent({
|
|||
}
|
||||
|
||||
function modifyDate(v: string, d: Date | undefined = props.modelValue) {
|
||||
if (!d) d = new Date();
|
||||
if (!d) d = q_date.buildDate({ hours: 0, minutes: 0, seconds: 0 });
|
||||
if (/^\d{4}-\d\d-\d\d$/.test(v)) {
|
||||
const split = v.split('-');
|
||||
return q_date.adjustDate(d, {
|
||||
|
|
|
@ -17,8 +17,12 @@ export function formatDateTime(
|
|||
return dateTimeFormat.format(date);
|
||||
}
|
||||
|
||||
export function asDate(date?: Date) {
|
||||
return date ? formatDateTime(date, true) : '';
|
||||
}
|
||||
|
||||
export function asHour(date?: Date) {
|
||||
if (date) return formatDateTime(date, false, true);
|
||||
return date ? formatDateTime(date, false, true) : '';
|
||||
}
|
||||
|
||||
export function startOfWeek(date: Date, startMonday = true) {
|
||||
|
|
Loading…
Reference in New Issue