release v2.0.0 #4
|
@ -127,7 +127,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
function modifyDate(v: string, d: Date | undefined = props.modelValue) {
|
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)) {
|
if (/^\d{4}-\d\d-\d\d$/.test(v)) {
|
||||||
const split = v.split('-');
|
const split = v.split('-');
|
||||||
return q_date.adjustDate(d, {
|
return q_date.adjustDate(d, {
|
||||||
|
|
|
@ -17,8 +17,12 @@ export function formatDateTime(
|
||||||
return dateTimeFormat.format(date);
|
return dateTimeFormat.format(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function asDate(date?: Date) {
|
||||||
|
return date ? formatDateTime(date, true) : '';
|
||||||
|
}
|
||||||
|
|
||||||
export function asHour(date?: Date) {
|
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) {
|
export function startOfWeek(date: Date, startMonday = true) {
|
||||||
|
|
Loading…
Reference in New Issue